Switch the cairo win32 create similar call over to createdib instead. Avoids wasted...
authorhyatt <hyatt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 24 May 2006 08:28:10 +0000 (08:28 +0000)
committerhyatt <hyatt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 24 May 2006 08:28:10 +0000 (08:28 +0000)
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@14558 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKitWin/ChangeLog
WebKitWin/WebFramePrivate.cpp

index 6f021fb..d7dc16d 100644 (file)
@@ -1,3 +1,14 @@
+2006-05-24  Dave Hyatt <hyatt@apple.com>
+
+        Don't use create_similar, since it does fills and work on
+        initialization.  Just make a DIB instead for the offscreen
+        surface.
+
+        Reviewed by maciej.
+
+        * WebFramePrivate.cpp:
+        (WebKit::WebFramePrivate::paint):
+
 2006-05-22  Steve Falkenburg  <sfalken@apple.com>
 
         Reviewed by adele.
index cde2246..e209168 100644 (file)
@@ -192,10 +192,9 @@ void WebFramePrivate::paint()
     PAINTSTRUCT ps;
     HDC hdc = BeginPaint(d->webView->windowHandle(), &ps);
     cairo_surface_t* finalSurface = cairo_win32_surface_create(hdc);
-    cairo_surface_t* surface = cairo_surface_create_similar(finalSurface,
-                                                            CAIRO_CONTENT_COLOR_ALPHA,
-                                                            ps.rcPaint.right - ps.rcPaint.left,
-                                                            ps.rcPaint.bottom - ps.rcPaint.top);
+    cairo_surface_t* surface = cairo_win32_surface_create_with_dib(CAIRO_FORMAT_ARGB32,
+                                                                   ps.rcPaint.right - ps.rcPaint.left,
+                                                                   ps.rcPaint.bottom - ps.rcPaint.top);
 
     cairo_t* context = cairo_create(surface);
     static cairo_font_options_t* fontOptions;
@@ -209,11 +208,8 @@ void WebFramePrivate::paint()
     IntRect documentDirtyRect = ps.rcPaint;
     documentDirtyRect.move(d->frameView->contentsX(), d->frameView->contentsY());
 
-    // FIXME: We have to set the transform using both cairo and GDI until we use cairo for text.
     HDC surfaceDC = cairo_win32_surface_get_dc(surface);
     SaveDC(surfaceDC);
-    OffsetViewportOrgEx(surfaceDC, -d->frameView->contentsX() - ps.rcPaint.left, 
-                                   -d->frameView->contentsY() - ps.rcPaint.top, 0);
     cairo_translate(context, -d->frameView->contentsX() - ps.rcPaint.left, 
                              -d->frameView->contentsY() - ps.rcPaint.top);
     d->frame->paint(&gc, documentDirtyRect);