- Source/WebKit2/ChangeLog +25 lines
Lines 1-3 Source/WebKit2/ChangeLog_sec1
1
2011-01-18  Anders Carlsson  <andersca@apple.com>
2
3
        Reviewed by NOBODY (OOPS!).
4
5
        Pass the web page proxy to BackingStore::create
6
        https://bugs.webkit.org/show_bug.cgi?id=52673
7
8
        * UIProcess/BackingStore.cpp:
9
        (WebKit::BackingStore::create):
10
        Add WebPageProxy parameter.
11
    
12
        (WebKit::BackingStore::BackingStore):
13
        Add WebPageProxy parameter.
14
15
        * UIProcess/BackingStore.h:
16
        Add WebPageProxy member variable.
17
18
        * UIProcess/DrawingAreaProxyImpl.cpp:
19
        (WebKit::DrawingAreaProxyImpl::incorporateUpdate):
20
        Pass the web page proxy when creating the backing store.
21
22
        * UIProcess/mac/BackingStoreMac.mm:
23
        (WebKit::BackingStore::backingStoreContext):
24
        Set the default blend mode.
25
1
2011-01-18  Anders Carlsson  <andersca@apple.com>
26
2011-01-18  Anders Carlsson  <andersca@apple.com>
2
27
3
        Reviewed by Darin Adler.
28
        Reviewed by Darin Adler.
- Source/WebKit2/UIProcess/BackingStore.cpp -3 / +4 lines
Lines 33-45 using namespace WebCore; Source/WebKit2/UIProcess/BackingStore.cpp_sec1
33
33
34
namespace WebKit {
34
namespace WebKit {
35
35
36
PassOwnPtr<BackingStore> BackingStore::create(const IntSize& size)
36
PassOwnPtr<BackingStore> BackingStore::create(const IntSize& size, WebPageProxy* webPageProxy)
37
{
37
{
38
    return adoptPtr(new BackingStore(size));
38
    return adoptPtr(new BackingStore(size, webPageProxy));
39
}
39
}
40
40
41
BackingStore::BackingStore(const IntSize& size)
41
BackingStore::BackingStore(const IntSize& size, WebPageProxy* webPageProxy)
42
    : m_size(size)
42
    : m_size(size)
43
    , m_webPageProxy(webPageProxy)
43
{
44
{
44
    ASSERT(!m_size.isEmpty());
45
    ASSERT(!m_size.isEmpty());
45
}
46
}
- Source/WebKit2/UIProcess/BackingStore.h -2 / +4 lines
Lines 47-53 class BackingStore { Source/WebKit2/UIProcess/BackingStore.h_sec1
47
    WTF_MAKE_NONCOPYABLE(BackingStore);
47
    WTF_MAKE_NONCOPYABLE(BackingStore);
48
48
49
public:
49
public:
50
    static PassOwnPtr<BackingStore> create(const WebCore::IntSize&);
50
    static PassOwnPtr<BackingStore> create(const WebCore::IntSize&, WebPageProxy*);
51
    ~BackingStore();
51
    ~BackingStore();
52
52
53
#if PLATFORM(MAC)
53
#if PLATFORM(MAC)
Lines 58-72 public: Source/WebKit2/UIProcess/BackingStore.h_sec2
58
    void incorporateUpdate(const UpdateInfo&);
58
    void incorporateUpdate(const UpdateInfo&);
59
59
60
private:
60
private:
61
    explicit BackingStore(const WebCore::IntSize&);
61
    BackingStore(const WebCore::IntSize&, WebPageProxy*);
62
62
63
    void scroll(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollOffset);
63
    void scroll(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollOffset);
64
64
65
    WebCore::IntSize m_size;
65
    WebCore::IntSize m_size;
66
    WebPageProxy* m_webPageProxy;
66
67
67
#if PLATFORM(MAC)
68
#if PLATFORM(MAC)
68
    CGContextRef backingStoreContext();
69
    CGContextRef backingStoreContext();
69
70
71
    RetainPtr<CGLayerRef> m_cgLayer;
70
    RetainPtr<CGContextRef> m_bitmapContext;
72
    RetainPtr<CGContextRef> m_bitmapContext;
71
#endif
73
#endif
72
};
74
};
- Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp -1 / +1 lines
Lines 113-119 void DrawingAreaProxyImpl::incorporateUp Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp_sec1
113
    // FIXME: Check for the update bounds being empty here.
113
    // FIXME: Check for the update bounds being empty here.
114
114
115
    if (!m_backingStore)
115
    if (!m_backingStore)
116
        m_backingStore = BackingStore::create(updateInfo.viewSize);
116
        m_backingStore = BackingStore::create(updateInfo.viewSize, m_webPageProxy);
117
117
118
    m_backingStore->incorporateUpdate(updateInfo);
118
    m_backingStore->incorporateUpdate(updateInfo);
119
119
- Source/WebKit2/UIProcess/mac/BackingStoreMac.mm -1 / +3 lines
Lines 47-53 CGContextRef BackingStore::backingStoreC Source/WebKit2/UIProcess/mac/BackingStoreMac.mm_sec1
47
        RetainPtr<CGColorSpaceRef> colorSpace(AdoptCF, CGColorSpaceCreateDeviceRGB());
47
        RetainPtr<CGColorSpaceRef> colorSpace(AdoptCF, CGColorSpaceCreateDeviceRGB());
48
        
48
        
49
        m_bitmapContext.adoptCF(CGBitmapContextCreate(0, m_size.width(), m_size.height(), 8, m_size.width() * 4, colorSpace.get(), kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host));
49
        m_bitmapContext.adoptCF(CGBitmapContextCreate(0, m_size.width(), m_size.height(), 8, m_size.width() * 4, colorSpace.get(), kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host));
50
        
50
51
        CGContextSetBlendMode(m_bitmapContext.get(), kCGBlendModeCopy);
52
51
        // We want the origin to be in the top left corner so flip the backing store context.
53
        // We want the origin to be in the top left corner so flip the backing store context.
52
        CGContextTranslateCTM(m_bitmapContext.get(), 0, m_size.height());
54
        CGContextTranslateCTM(m_bitmapContext.get(), 0, m_size.height());
53
        CGContextScaleCTM(m_bitmapContext.get(), 1, -1);
55
        CGContextScaleCTM(m_bitmapContext.get(), 1, -1);

Return to Bug 52673