| 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 828ade928ec69db13c2794ea1c4af27603076af7..581ef40acf18ab343ba51e8eef7d3fcbd696f578 100644
|
| --- a/third_party/WebKit/Source/platform/graphics/ImageBuffer.cpp
|
| +++ b/third_party/WebKit/Source/platform/graphics/ImageBuffer.cpp
|
| @@ -35,6 +35,7 @@
|
| #include "gpu/command_buffer/client/gles2_interface.h"
|
| #include "platform/MIMETypeRegistry.h"
|
| #include "platform/geometry/IntRect.h"
|
| +#include "platform/graphics/ExpensiveCanvasHeuristicParameters.h"
|
| #include "platform/graphics/GraphicsContext.h"
|
| #include "platform/graphics/ImageBufferClient.h"
|
| #include "platform/graphics/StaticBitmapImage.h"
|
| @@ -125,6 +126,17 @@ bool ImageBuffer::isDirty()
|
| return m_client ? m_client->isDirty() : false;
|
| }
|
|
|
| +void ImageBuffer::didDisableAcceleration() const
|
| +{
|
| + DCHECK(m_gpuMemoryUsage);
|
| + DCHECK_GT(s_globalAcceleratedImageBufferCount, 0u);
|
| + if (m_client)
|
| + m_client->didDisableAcceleration();
|
| + s_globalAcceleratedImageBufferCount--;
|
| + s_globalGPUMemoryUsage -= m_gpuMemoryUsage;
|
| + m_gpuMemoryUsage = 0;
|
| +}
|
| +
|
| void ImageBuffer::didFinalizeFrame()
|
| {
|
| if (m_client)
|
| @@ -307,7 +319,8 @@ bool ImageBuffer::getImageData(Multiply multiplied, const IntRect& rect, WTF::Ar
|
| }
|
|
|
| DCHECK(canvas());
|
| - RefPtr<SkImage> snapshot = m_surface->newImageSnapshot(PreferNoAcceleration, SnapshotReasonGetImageData);
|
| + AccelerationHint hint = (ExpensiveCanvasHeuristicParameters::GetImageDataForcesNoAcceleration) ? ForceNoAcceleration : PreferNoAcceleration;
|
| + RefPtr<SkImage> snapshot = m_surface->newImageSnapshot(hint, SnapshotReasonGetImageData);
|
| if (!snapshot)
|
| return false;
|
|
|
|
|