[Webkit-unassigned] [Bug 16979] Patch to conditionalize some CG/Cairo support in win32

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jan 31 06:33:20 PST 2008


http://bugs.webkit.org/show_bug.cgi?id=16979


aroben at apple.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #18811|review?                     |review-
               Flag|                            |




------- Comment #34 from aroben at apple.com  2008-01-31 06:33 PDT -------
(From update of attachment 18811)
+    if (dc) {
+        cairo_surface_t* surface = cairo_win32_surface_create(dc);
+        m_data->cr = cairo_create(surface);
+       m_data->m_hdc = dc;
+    } else {
+        setPaintingDisabled(true);
+        m_data->cr = 0;
+       m_data->m_hdc = 0;
+    }

There are some tabs here that will have to be removed before landing.

 void BitmapImage::drawFrameMatchingSourceSize(GraphicsContext* ctxt, const
FloatRect& dstRect, const IntSize& srcSize, CompositeOperator compositeOp)
 {
     int frames = frameCount();
+    size_t imageHeight = 0;
+    size_t imageWidth = 0;
     for (int i = 0; i < frames; ++i) {
-        CGImageRef image = frameAtIndex(i);
-        if (CGImageGetHeight(image) == (size_t)srcSize.height() &&
CGImageGetWidth(image) == (size_t)srcSize.width()) {
+        NativeImagePtr image = frameAtIndex(i);
+        imageHeight = CGImageGetHeight(image);
+        imageWidth = CGImageGetWidth(image);
+        if (imageHeight == static_cast<size_t>(srcSize.height()) && imageWidth
== static_cast<size_t>(srcSize.width())) {

I still don't think imageHeight and imageWidth should be moved out of the loop
like this, and we should be using CGImageRef instead of NativeImagePtr. Similar
comments apply to ImageCairoWin.cpp.

It's great that this builds now! These last couple of issues are the only
problems I see.


-- 
Configure bugmail: http://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list