Chromium Code Reviews| Index: third_party/WebKit/Source/platform/graphics/ImageBufferSurface.cpp |
| diff --git a/third_party/WebKit/Source/platform/graphics/ImageBufferSurface.cpp b/third_party/WebKit/Source/platform/graphics/ImageBufferSurface.cpp |
| index 34c68bf2dc6ec8a035a7e3e1f83b9e53c45b7e36..f5f1208688aba1521f15984fecd13a5ee0c33556 100644 |
| --- a/third_party/WebKit/Source/platform/graphics/ImageBufferSurface.cpp |
| +++ b/third_party/WebKit/Source/platform/graphics/ImageBufferSurface.cpp |
| @@ -35,11 +35,23 @@ |
| #include "platform/graphics/GraphicsContext.h" |
| #include "platform/graphics/ImageBuffer.h" |
| #include "platform/graphics/StaticBitmapImage.h" |
| +#include "third_party/skia/include/core/SkBitmap.h" |
| #include "third_party/skia/include/core/SkCanvas.h" |
| -#include "third_party/skia/include/core/SkDevice.h" |
| #include "third_party/skia/include/core/SkImage.h" |
| #include "third_party/skia/include/core/SkPicture.h" |
| +namespace { |
| + |
| +SkBitmap ReadPixels(SkCanvas* canvas) |
|
Justin Novosad
2015/11/04 16:29:36
Blink style: 'readPixels'
|
| +{ |
| + SkBitmap bitmap; |
| + bitmap.setInfo(canvas->imageInfo()); |
| + canvas->readPixels(&bitmap, 0, 0); |
| + return bitmap; |
| +} |
| + |
| +} |
| + |
| namespace blink { |
| ImageBufferSurface::ImageBufferSurface(const IntSize& size, OpacityMode opacityMode) |
| @@ -81,10 +93,10 @@ void ImageBufferSurface::draw(GraphicsContext* context, const FloatRect& destRec |
| context->drawImage(image.get(), destRect, srcRect, op); |
| } |
| -const SkBitmap& ImageBufferSurface::deprecatedBitmapForOverwrite() |
| +const SkBitmap ImageBufferSurface::deprecatedBitmapForOverwrite() |
| { |
| ASSERT_NOT_REACHED(); // should only be called on non-accelerated surface types, which have overrides |
| - return canvas()->getDevice()->accessBitmap(false); // Because we have to return something for the code to compile, and it can't be a local (by address). |
| + return ReadPixels(canvas()); |
|
f(malita)
2015/11/05 13:53:26
This looks like we're just trying to make the comp
|
| } |