Permalink
Browse files

Unreviewed, rolling out r125833.

http://trac.webkit.org/changeset/125833
https://bugs.webkit.org/show_bug.cgi?id=94234

Was not the cause of the test failures. Per
http://crbug.com/143311 , it is probably WebKit r125800.

* platform/graphics/chromium/Canvas2DLayerBridge.cpp:
(WebCore::Canvas2DLayerBridge::~Canvas2DLayerBridge):
(WebCore::Canvas2DLayerBridge::deferredCanvas):
(WebCore):
(WebCore::Canvas2DLayerBridge::prepareForDraw):
(WebCore::Canvas2DLayerBridge::skCanvas):
* platform/graphics/chromium/Canvas2DLayerBridge.h:
(Canvas2DLayerBridge):
* platform/graphics/skia/ImageBufferSkia.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125841 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information...
1 parent 83efd73 commit a3625977e8dde353e4399925b331904e9b6dc08c @kenrussell kenrussell committed Aug 17, 2012
View
@@ -1,3 +1,22 @@
+2012-08-16 Kenneth Russell <kbr@google.com>
+
+ Unreviewed, rolling out r125833.
+ http://trac.webkit.org/changeset/125833
+ https://bugs.webkit.org/show_bug.cgi?id=94234
+
+ Was not the cause of the test failures. Per
+ http://crbug.com/143311 , it is probably WebKit r125800.
+
+ * platform/graphics/chromium/Canvas2DLayerBridge.cpp:
+ (WebCore::Canvas2DLayerBridge::~Canvas2DLayerBridge):
+ (WebCore::Canvas2DLayerBridge::deferredCanvas):
+ (WebCore):
+ (WebCore::Canvas2DLayerBridge::prepareForDraw):
+ (WebCore::Canvas2DLayerBridge::skCanvas):
+ * platform/graphics/chromium/Canvas2DLayerBridge.h:
+ (Canvas2DLayerBridge):
+ * platform/graphics/skia/ImageBufferSkia.cpp:
+
2012-08-16 Antoine Labour <piman@chromium.org>
[chromium] Add resource transfer functions to CCResourceProvider
@@ -31,8 +31,6 @@
#include "GraphicsContext3D.h"
#include "GraphicsContext3DPrivate.h"
#include "LayerRendererChromium.h" // For GLC() macro.
-#include "SkCanvas.h"
-#include "SkDeferredCanvas.h"
#include "TraceEvent.h"
#include <public/WebCompositor.h>
#include <public/WebGraphicsContext3D.h>
@@ -43,31 +41,6 @@ using WebKit::WebTextureUpdater;
namespace WebCore {
-class AcceleratedDeviceContext : public SkDeferredCanvas::DeviceContext {
-public:
- AcceleratedDeviceContext(WebGraphicsContext3D* context, WebExternalTextureLayer layer, bool useDoubleBuffering)
- : m_layer(layer)
- , m_context()
- , m_useDoubleBuffering(useDoubleBuffering)
- {
- ASSERT(context);
- ASSERT(!layer.isNull());
- m_context = context;
- }
-
- virtual void prepareForDraw()
- {
- if (!m_useDoubleBuffering)
- m_layer.willModifyTexture();
- m_context->makeContextCurrent();
- }
-
-private:
- WebExternalTextureLayer m_layer;
- WebGraphicsContext3D* m_context;
- bool m_useDoubleBuffering;
-};
-
Canvas2DLayerBridge::Canvas2DLayerBridge(PassRefPtr<GraphicsContext3D> context, const IntSize& size, DeferralMode deferralMode, unsigned textureId)
: m_deferralMode(deferralMode)
// FIXME: We currently turn off double buffering when canvas rendering is
@@ -101,9 +74,10 @@ Canvas2DLayerBridge::Canvas2DLayerBridge(PassRefPtr<GraphicsContext3D> context,
m_layer.setRateLimitContext(!WebKit::WebCompositor::threadingEnabled() || m_useDoubleBuffering);
}
-
Canvas2DLayerBridge::~Canvas2DLayerBridge()
{
+ if (SkDeferredCanvas* deferred = deferredCanvas())
+ deferred->setNotificationClient(0);
m_layer.setTextureId(0);
if (m_useDoubleBuffering) {
m_context->makeContextCurrent();
@@ -113,11 +87,28 @@ Canvas2DLayerBridge::~Canvas2DLayerBridge()
m_layer.clearClient();
}
+SkDeferredCanvas* Canvas2DLayerBridge::deferredCanvas()
+{
+ if (m_deferralMode == Deferred)
+ return static_cast<SkDeferredCanvas*>(m_canvas);
+ return 0;
+}
+
+void Canvas2DLayerBridge::prepareForDraw()
+{
+ ASSERT(deferredCanvas());
+ if (!m_useDoubleBuffering)
+ m_layer.willModifyTexture();
+ m_context->makeContextCurrent();
+}
+
SkCanvas* Canvas2DLayerBridge::skCanvas(SkDevice* device)
{
+ ASSERT(!m_canvas);
if (m_deferralMode == Deferred) {
- SkAutoTUnref<AcceleratedDeviceContext> deviceContext(new AcceleratedDeviceContext(context(), m_layer, m_useDoubleBuffering));
- m_canvas = new SkDeferredCanvas(device, deviceContext.get());
+ SkDeferredCanvas* deferred = new SkDeferredCanvas(device);
+ deferred->setNotificationClient(this);
+ m_canvas = deferred;
} else
m_canvas = new SkCanvas(device);
@@ -29,14 +29,12 @@
#include "GraphicsContext3D.h"
#include "ImageBuffer.h" // For DeferralMode enum.
#include "IntSize.h"
+#include "SkDeferredCanvas.h"
#include <public/WebExternalTextureLayer.h>
#include <public/WebExternalTextureLayerClient.h>
#include <wtf/PassOwnPtr.h>
#include <wtf/RefPtr.h>
-class SkCanvas;
-class SkDevice;
-
namespace WebKit {
class WebGraphicsContext3D;
}
@@ -45,7 +43,7 @@ namespace WebCore {
class LayerChromium;
-class Canvas2DLayerBridge : public WebKit::WebExternalTextureLayerClient {
+class Canvas2DLayerBridge : public WebKit::WebExternalTextureLayerClient, public SkDeferredCanvas::NotificationClient {
WTF_MAKE_NONCOPYABLE(Canvas2DLayerBridge);
public:
static PassOwnPtr<Canvas2DLayerBridge> create(PassRefPtr<GraphicsContext3D> context, const IntSize& size, DeferralMode deferralMode, unsigned textureId)
@@ -59,6 +57,9 @@ class Canvas2DLayerBridge : public WebKit::WebExternalTextureLayerClient {
virtual unsigned prepareTexture(WebKit::WebTextureUpdater&) OVERRIDE;
virtual WebKit::WebGraphicsContext3D* context() OVERRIDE;
+ // SkDeferredCanvas::NotificationClient implementation
+ virtual void prepareForDraw();
+
SkCanvas* skCanvas(SkDevice*);
WebKit::WebLayer* layer();
void contextAcquired();
@@ -67,6 +68,7 @@ class Canvas2DLayerBridge : public WebKit::WebExternalTextureLayerClient {
private:
Canvas2DLayerBridge(PassRefPtr<GraphicsContext3D>, const IntSize&, DeferralMode, unsigned textureId);
+ SkDeferredCanvas* deferredCanvas();
DeferralMode m_deferralMode;
bool m_useDoubleBuffering;
@@ -46,7 +46,6 @@
#include "PlatformContextSkia.h"
#include "SharedGraphicsContext3D.h"
#include "SkColorPriv.h"
-#include "SkDeferredCanvas.h"
#include "SkGpuDevice.h"
#include "SkiaUtils.h"
#include "WEBPImageEncoder.h"

0 comments on commit a362597

Please sign in to comment.