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

Unified Diff: third_party/WebKit/Source/platform/graphics/ImageBuffer.cpp

Issue 2063473002: Make 2D canvas disable gpu acceleration when getImageData is called (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months 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: 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 ccc1972b4c5258a934ce745d65d6dac9025ae82e..406c50f366cffdd860744467f4efb1f10f727acf 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"
@@ -300,7 +301,8 @@ bool ImageBuffer::getImageData(Multiply multiplied, const IntRect& rect, WTF::Ar
}
ASSERT(canvas());
- RefPtr<SkImage> snapshot = m_surface->newImageSnapshot(PreferNoAcceleration, SnapshotReasonGetImageData);
+ AccelerationHint hint = ExpensiveCanvasHeuristicParameters::GetImageDataForcesNoAcceleration ? ForceNoAcceleration : PreferNoAcceleration;
xidachen 2016/06/15 14:12:36 We should probably do the same thing in putImageDa
+ RefPtr<SkImage> snapshot = m_surface->newImageSnapshot(hint, SnapshotReasonGetImageData);
if (!snapshot)
return false;

Powered by Google App Engine
This is Rietveld 408576698