Changeset 76072 in webkit


Ignore:
Timestamp:
Jan 18, 2011 3:08:18 PM (13 years ago)
Author:
andersca@apple.com
Message:

2011-01-18 Anders Carlsson <andersca@apple.com>

Reviewed by Darin Adler.

Factor code to create the backing store bitmap context out into a new function
https://bugs.webkit.org/show_bug.cgi?id=52670

  • UIProcess/BackingStore.h:
  • UIProcess/mac/BackingStoreMac.mm: (WebKit::BackingStore::backingStoreContext): Create the backing store context.

(WebKit::BackingStore::incorporateUpdate):
Call backingStoreContext.

(WebKit::BackingStore::scroll):
Assert that the context is not null.

Location:
trunk/Source/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r76069 r76072  
     12011-01-18  Anders Carlsson  <andersca@apple.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        Factor code to create the backing store bitmap context out into a new function
     6        https://bugs.webkit.org/show_bug.cgi?id=52670
     7
     8        * UIProcess/BackingStore.h:
     9        * UIProcess/mac/BackingStoreMac.mm:
     10        (WebKit::BackingStore::backingStoreContext):
     11        Create the backing store context.
     12
     13        (WebKit::BackingStore::incorporateUpdate):
     14        Call backingStoreContext.
     15
     16        (WebKit::BackingStore::scroll):
     17        Assert that the context is not null.
     18
    1192011-01-18  Anders Carlsson  <andersca@apple.com>
    220
  • trunk/Source/WebKit2/UIProcess/BackingStore.h

    r76061 r76072  
    6666
    6767#if PLATFORM(MAC)
     68    CGContextRef backingStoreContext();
     69
    6870    RetainPtr<CGContextRef> m_bitmapContext;
    6971#endif
  • trunk/Source/WebKit2/UIProcess/mac/BackingStoreMac.mm

    r76061 r76072  
    4242}
    4343
    44 void BackingStore::incorporateUpdate(const UpdateInfo& updateInfo)
     44CGContextRef BackingStore::backingStoreContext()
    4545{
    46     ASSERT(m_size == updateInfo.viewSize);
    47 
    48     RefPtr<ShareableBitmap> bitmap = ShareableBitmap::create(updateInfo.updateRectBounds.size(), updateInfo.bitmapHandle);
    49     if (!bitmap)
    50         return;
    51 
    5246    if (!m_bitmapContext) {
    5347        RetainPtr<CGColorSpaceRef> colorSpace(AdoptCF, CGColorSpaceCreateDeviceRGB());
     
    6054    }
    6155
     56    return m_bitmapContext.get();
     57}
     58
     59void BackingStore::incorporateUpdate(const UpdateInfo& updateInfo)
     60{
     61    ASSERT(m_size == updateInfo.viewSize);
     62
     63    RefPtr<ShareableBitmap> bitmap = ShareableBitmap::create(updateInfo.updateRectBounds.size(), updateInfo.bitmapHandle);
     64    if (!bitmap)
     65        return;
     66
     67    CGContextRef context = backingStoreContext();
     68
    6269    scroll(updateInfo.scrollRect, updateInfo.scrollOffset);
    6370
    6471    IntPoint updateRectLocation = updateInfo.updateRectBounds.location();
    6572
    66     GraphicsContext graphicsContext(m_bitmapContext.get());
     73    GraphicsContext graphicsContext(context);
    6774
    6875    // Paint all update rects.
     
    8188        return;
    8289
     90    ASSERT(m_bitmapContext);
     91
    8392    CGContextSaveGState(m_bitmapContext.get());
    8493
Note: See TracChangeset for help on using the changeset viewer.