Chromium Code Reviews| Index: Source/core/platform/graphics/GraphicsContextTest.cpp |
| diff --git a/Source/core/platform/graphics/GraphicsContextTest.cpp b/Source/core/platform/graphics/GraphicsContextTest.cpp |
| index b53f27864c45a9e7d4dddfb25c4cbee07426a91d..d745ebaa260853364dac1878ebc101cfc99df2e5 100644 |
| --- a/Source/core/platform/graphics/GraphicsContextTest.cpp |
| +++ b/Source/core/platform/graphics/GraphicsContextTest.cpp |
| @@ -31,6 +31,7 @@ |
| #include "core/platform/graphics/ImageBuffer.h" |
| #include "core/platform/graphics/skia/NativeImageSkia.h" |
| #include "platform/graphics/DisplayList.h" |
| +#include "platform/graphics/UnacceleratedImageBufferSurface.h" |
| #include "third_party/skia/include/core/SkBitmapDevice.h" |
| #include <gtest/gtest.h> |
| @@ -244,11 +245,12 @@ TEST(GraphicsContextTest, trackImageMask) |
| context.setCompositeOperation(CompositeDestinationIn); |
| context.beginTransparencyLayer(1); |
| - OwnPtr<ImageBuffer> alphaImage = ImageBuffer::create(IntSize(100, 100)); |
| - alphaImage->context()->fillRect(IntRect(0, 0, 100, 100), alpha); |
| + OwnPtr<ImageBufferSurface> surface = adoptPtr(new UnacceleratedImageBufferSurface(IntSize(100, 100))); |
| + ImageBuffer alphaImage(surface.release()); |
|
Stephen White
2013/12/04 21:18:40
Ooooh, ImageBuffer on the stack. *mindblown*
|
| + alphaImage.context()->fillRect(IntRect(0, 0, 100, 100), alpha); |
| context.setCompositeOperation(CompositeSourceOver); |
| - context.drawImageBuffer(alphaImage.get(), FloatRect(10, 10, 10, 10)); |
| + context.drawImageBuffer(&alphaImage, FloatRect(10, 10, 10, 10)); |
| context.endLayer(); |
| context.endLayer(); |
| @@ -282,11 +284,12 @@ TEST(GraphicsContextTest, trackImageMaskWithOpaqueRect) |
| context.setCompositeOperation(CompositeDestinationIn); |
| context.beginTransparencyLayer(1); |
| - OwnPtr<ImageBuffer> alphaImage = ImageBuffer::create(IntSize(100, 100)); |
| - alphaImage->context()->fillRect(IntRect(0, 0, 100, 100), alpha); |
| + OwnPtr<ImageBufferSurface> surface = adoptPtr(new UnacceleratedImageBufferSurface(IntSize(100, 100))); |
| + ImageBuffer alphaImage(surface.release()); |
| + alphaImage.context()->fillRect(IntRect(0, 0, 100, 100), alpha); |
| context.setCompositeOperation(CompositeSourceOver); |
| - context.drawImageBuffer(alphaImage.get(), FloatRect(10, 10, 10, 10)); |
| + context.drawImageBuffer(&alphaImage, FloatRect(10, 10, 10, 10)); |
| // We can't have an opaque mask actually, but we can pretend here like it would look if we did. |
| context.fillRect(FloatRect(12, 12, 3, 3), opaque, CompositeSourceOver); |