Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(383)

Unified Diff: Source/core/platform/graphics/Canvas2DLayerBridgeTest.cpp

Issue 104023007: Refactoring ImageBuffer to decouple it from Canvas2DLayerBridge (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: build fixes for win+mac Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/platform/graphics/Canvas2DLayerBridgeTest.cpp
diff --git a/Source/core/platform/graphics/Canvas2DLayerBridgeTest.cpp b/Source/core/platform/graphics/Canvas2DLayerBridgeTest.cpp
index 391808afeb61672d6717a93fa7e8359a59dedd9c..3f60d4567a4252907fb5af06639a692d533c7efe 100644
--- a/Source/core/platform/graphics/Canvas2DLayerBridgeTest.cpp
+++ b/Source/core/platform/graphics/Canvas2DLayerBridgeTest.cpp
@@ -55,12 +55,12 @@ public:
class FakeCanvas2DLayerBridge : public Canvas2DLayerBridge {
public:
- static PassRefPtr<Canvas2DLayerBridge> create(PassRefPtr<GraphicsContext3D> context, PassRefPtr<SkDeferredCanvas> canvas, OpacityMode opacityMode)
+ static PassRefPtr<Canvas2DLayerBridge> create(PassRefPtr<GraphicsContext3D> context, PassOwnPtr<SkDeferredCanvas> canvas, OpacityMode opacityMode)
{
return adoptRef(static_cast<Canvas2DLayerBridge*>(new FakeCanvas2DLayerBridge(context, canvas, opacityMode)));
}
protected:
- FakeCanvas2DLayerBridge(PassRefPtr<GraphicsContext3D> context, PassRefPtr<SkDeferredCanvas> canvas, OpacityMode opacityMode) :
+ FakeCanvas2DLayerBridge(PassRefPtr<GraphicsContext3D> context, PassOwnPtr<SkDeferredCanvas> canvas, OpacityMode opacityMode) :
Canvas2DLayerBridge(context, canvas, 0, opacityMode)
{ }
};
@@ -75,20 +75,21 @@ protected:
MockCanvasContext& mainMock = *static_cast<MockCanvasContext*>(mainContext->webContext());
- RefPtr<SkDeferredCanvas> canvas = adoptRef(SkDeferredCanvas::Create(SkSurface::NewRasterPMColor(300, 150)));
+ OwnPtr<SkDeferredCanvas> canvas = adoptPtr(SkDeferredCanvas::Create(SkSurface::NewRasterPMColor(300, 150)));
::testing::Mock::VerifyAndClearExpectations(&mainMock);
- Canvas2DLayerBridgePtr bridge = FakeCanvas2DLayerBridge::create(mainContext.release(), canvas.release(), Canvas2DLayerBridge::NonOpaque);
+ RefPtr<Canvas2DLayerBridge> bridge = FakeCanvas2DLayerBridge::create(mainContext.release(), canvas.release(), NonOpaque);
::testing::Mock::VerifyAndClearExpectations(&mainMock);
EXPECT_CALL(mainMock, flush());
- unsigned textureId = bridge->backBufferTexture();
+ unsigned textureId = bridge->getBackingTexture();
EXPECT_EQ(textureId, 0u);
::testing::Mock::VerifyAndClearExpectations(&mainMock);
+ bridge->destroy();
bridge.clear();
::testing::Mock::VerifyAndClearExpectations(&mainMock);

Powered by Google App Engine
This is Rietveld 408576698