[chromium] Guard accelerated skia drawing logic with its own define to remove depende...
authorjamesr@google.com <jamesr@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Sep 2011 23:51:09 +0000 (23:51 +0000)
committerjamesr@google.com <jamesr@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Sep 2011 23:51:09 +0000 (23:51 +0000)
https://bugs.webkit.org/show_bug.cgi?id=68953

Reviewed by Kenneth Russell.

The accelerated drawing code is incompatible with threaded compositing. Rather than tying the two behaviors
together via USE(THREADED_COMPOSITING), this patch guards the accelerated drawing code with its own USE() guard
so the features can advance independently. Today, it's not safe to set both of these flags.

* platform/graphics/chromium/ContentLayerChromium.cpp:
(WebCore::ContentLayerChromium::createTextureUpdater):
* platform/graphics/chromium/LayerTextureUpdaterCanvas.cpp:
* platform/graphics/chromium/LayerTextureUpdaterCanvas.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@96172 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp
Source/WebCore/platform/graphics/chromium/LayerTextureUpdaterCanvas.cpp
Source/WebCore/platform/graphics/chromium/LayerTextureUpdaterCanvas.h

index b8e116c..f5079fd 100644 (file)
@@ -1,3 +1,19 @@
+2011-09-27  James Robinson  <jamesr@chromium.org>
+
+        [chromium] Guard accelerated skia drawing logic with its own define to remove dependency on USE(THREADED_COMPOSITING)
+        https://bugs.webkit.org/show_bug.cgi?id=68953
+
+        Reviewed by Kenneth Russell.
+
+        The accelerated drawing code is incompatible with threaded compositing. Rather than tying the two behaviors
+        together via USE(THREADED_COMPOSITING), this patch guards the accelerated drawing code with its own USE() guard
+        so the features can advance independently. Today, it's not safe to set both of these flags.
+
+        * platform/graphics/chromium/ContentLayerChromium.cpp:
+        (WebCore::ContentLayerChromium::createTextureUpdater):
+        * platform/graphics/chromium/LayerTextureUpdaterCanvas.cpp:
+        * platform/graphics/chromium/LayerTextureUpdaterCanvas.h:
+
 2011-09-27  Luke Macpherson   <macpherson@chromium.org>
 
         Slightly improve performance of CSSStyleApplyProperty handler lookup.
index 81f7f14..9de4da9 100644 (file)
@@ -120,8 +120,7 @@ bool ContentLayerChromium::drawsContent() const
 
 void ContentLayerChromium::createTextureUpdater(const CCLayerTreeHost* host)
 {
-#if !USE(THREADED_COMPOSITING)
-#if USE(SKIA)
+#if USE(SKIA) && USE(ACCELERATED_DRAWING)
     // Note that host->skiaContext() will crash if called while in threaded
     // mode. This thus depends on CCLayerTreeHost::initialize turning off
     // acceleratePainting to prevent this from crashing.
@@ -129,8 +128,7 @@ void ContentLayerChromium::createTextureUpdater(const CCLayerTreeHost* host)
         m_textureUpdater = LayerTextureUpdaterSkPicture::create(ContentLayerPainter::create(m_delegate));
         return;
     }
-#endif // SKIA
-#endif // !THREADED_COMPOSITING
+#endif // USE(SKIA) && USE(ACCELERATED_DRAWING)
 
     m_textureUpdater = LayerTextureUpdaterBitmap::create(ContentLayerPainter::create(m_delegate), host->layerRendererCapabilities().usingMapSub);
 }
index e35006f..ff19c71 100644 (file)
@@ -101,8 +101,7 @@ void LayerTextureUpdaterBitmap::updateTextureRect(GraphicsContext3D* context, Te
     m_texSubImage.upload(locker.pixels(), contentRect(), sourceRect, destRect, texture->format(), context);
 }
 
-#if !USE(THREADED_COMPOSITING)
-#if USE(SKIA)
+#if USE(SKIA) && USE(ACCELERATED_DRAWING)
 PassRefPtr<LayerTextureUpdaterSkPicture> LayerTextureUpdaterSkPicture::create(PassOwnPtr<LayerPainterChromium> painter)
 {
     return adoptRef(new LayerTextureUpdaterSkPicture(painter));
@@ -254,8 +253,7 @@ bool LayerTextureUpdaterSkPicture::createFrameBuffer()
     context()->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, 0);
     return true;
 }
-#endif // SKIA
-#endif // !THREADED_COMPOSITING
+#endif // USE(SKIA) && USE(ACCELERATED_DRAWING)
 
 } // namespace WebCore
 #endif // USE(ACCELERATED_COMPOSITING)
index 4849a1a..f423ad3 100644 (file)
@@ -79,7 +79,7 @@ private:
     LayerTextureSubImage m_texSubImage;
 };
 
-#if USE(SKIA)
+#if USE(SKIA) && USE(ACCELERATED_DRAWING)
 class LayerTextureUpdaterSkPicture : public LayerTextureUpdaterCanvas {
 public:
     static PassRefPtr<LayerTextureUpdaterSkPicture> create(PassOwnPtr<LayerPainterChromium>);
@@ -105,7 +105,7 @@ private:
     Platform3DObject m_depthStencilBuffer;
     OwnPtr<SkCanvas> m_canvas; // GPU accelerated canvas.
 };
-#endif // SKIA
+#endif // USE(SKIA) && USE(ACCELERATED_DRAWING)
 
 } // namespace WebCore
 #endif // USE(ACCELERATED_COMPOSITING)