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

Unified Diff: Source/core/html/HTMLCanvasElement.cpp

Issue 328883002: Accelerate small canvases if Ganesh is on. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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
« no previous file with comments | « no previous file | Source/core/loader/EmptyClients.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLCanvasElement.cpp
diff --git a/Source/core/html/HTMLCanvasElement.cpp b/Source/core/html/HTMLCanvasElement.cpp
index 8b0d798af50c69d4d865d79bbb35a37064fa7925..5b5505bdcb2eb191bcb6596d88e81c9c5f9fed4d 100644
--- a/Source/core/html/HTMLCanvasElement.cpp
+++ b/Source/core/html/HTMLCanvasElement.cpp
@@ -43,6 +43,7 @@
#include "core/html/canvas/WebGLContextAttributes.h"
#include "core/html/canvas/WebGLContextEvent.h"
#include "core/html/canvas/WebGLRenderingContext.h"
+#include "core/page/ChromeClient.h"
#include "core/rendering/RenderHTMLCanvas.h"
#include "platform/MIMETypeRegistry.h"
#include "platform/graphics/Canvas2DImageBufferSurface.h"
@@ -431,8 +432,9 @@ bool HTMLCanvasElement::shouldAccelerate(const IntSize& size) const
if (!settings || !settings->accelerated2dCanvasEnabled())
return false;
- // Do not use acceleration for small canvas.
- if (size.width() * size.height() < settings->minimumAccelerated2dCanvasSize())
+ // Do not use acceleration for small canvases, unless GPU rasterization is available.
+ // GPU raterization is a heuristic to avoid difficult content & whitelist targeted content.
+ if (!document().frame()->chromeClient().usesGpuRasterization() && size.width() * size.height() < settings->minimumAccelerated2dCanvasSize())
return false;
if (!blink::Platform::current()->canAccelerate2dCanvas())
« no previous file with comments | « no previous file | Source/core/loader/EmptyClients.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698