| Index: third_party/WebKit/Source/platform/graphics/ImageBuffer.cpp
|
| diff --git a/third_party/WebKit/Source/platform/graphics/ImageBuffer.cpp b/third_party/WebKit/Source/platform/graphics/ImageBuffer.cpp
|
| index 501bb05924e56f25e7bcb72807b5e07d610fe785..9727558b3f3eab4f11ee4869560fcce8d02381f6 100644
|
| --- a/third_party/WebKit/Source/platform/graphics/ImageBuffer.cpp
|
| +++ b/third_party/WebKit/Source/platform/graphics/ImageBuffer.cpp
|
| @@ -34,6 +34,7 @@
|
|
|
| #include "gpu/command_buffer/client/gles2_interface.h"
|
| #include "platform/MIMETypeRegistry.h"
|
| +#include "platform/RuntimeEnabledFeatures.h"
|
| #include "platform/geometry/IntRect.h"
|
| #include "platform/graphics/ExpensiveCanvasHeuristicParameters.h"
|
| #include "platform/graphics/GraphicsContext.h"
|
| @@ -321,8 +322,11 @@ bool ImageBuffer::getImageData(Multiply multiplied, const IntRect& rect, WTF::Ar
|
| }
|
|
|
| DCHECK(canvas());
|
| - AccelerationHint hint = (ExpensiveCanvasHeuristicParameters::GetImageDataForcesNoAcceleration) ? ForceNoAcceleration : PreferNoAcceleration;
|
| - RefPtr<SkImage> snapshot = m_surface->newImageSnapshot(hint, SnapshotReasonGetImageData);
|
| +
|
| + if (ExpensiveCanvasHeuristicParameters::GetImageDataForcesNoAcceleration && !RuntimeEnabledFeatures::canvas2dFixedRenderingModeEnabled())
|
| + const_cast<ImageBuffer*>(this)->disableAcceleration();
|
| +
|
| + RefPtr<SkImage> snapshot = m_surface->newImageSnapshot(PreferNoAcceleration, SnapshotReasonGetImageData);
|
| if (!snapshot)
|
| return false;
|
|
|
| @@ -414,9 +418,8 @@ public:
|
|
|
| void ImageBuffer::disableAcceleration()
|
| {
|
| - if (!isAccelerated()) {
|
| + if (!isAccelerated())
|
| return;
|
| - }
|
|
|
| // Get current frame.
|
| SkImage* image = m_surface->newImageSnapshot(PreferNoAcceleration, SnapshotReasonPaint).get();
|
|
|