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

Unified Diff: third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp

Issue 2687073003: Make disabling 2d canvas GPU acceleration for getImageData less aggressive. (Closed)
Patch Set: Address comments Created 3 years, 10 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 | third_party/WebKit/Source/platform/graphics/ExpensiveCanvasHeuristicParameters.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp
diff --git a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp
index 37560941691989bce939245140b9259d21f02287..fdaa4b3c18d1683b8077f62a7d714680af2ac868 100644
--- a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp
+++ b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp
@@ -988,10 +988,24 @@ TEST_F(CanvasRenderingContext2DTest, GetImageDataDisablesAcceleration) {
EXPECT_EQ(720000, getGlobalGPUMemoryUsage());
DummyExceptionStateForTesting exceptionState;
+ for (int i = 0;
+ i <
+ ExpensiveCanvasHeuristicParameters::GPUReadbackMinSuccessiveFrames - 1;
+ i++) {
+ context2d()->getImageData(0, 0, 1, 1, exceptionState);
+ canvasElement().finalizeFrame();
+
+ EXPECT_FALSE(exceptionState.hadException());
+ EXPECT_TRUE(canvasElement().buffer()->isAccelerated());
+ EXPECT_EQ(1u, getGlobalAcceleratedImageBufferCount());
+ EXPECT_EQ(720000, getGlobalGPUMemoryUsage());
+ }
+
context2d()->getImageData(0, 0, 1, 1, exceptionState);
+ canvasElement().finalizeFrame();
EXPECT_FALSE(exceptionState.hadException());
- if (ExpensiveCanvasHeuristicParameters::GetImageDataForcesNoAcceleration) {
+ if (ExpensiveCanvasHeuristicParameters::GPUReadbackForcesNoAcceleration) {
EXPECT_FALSE(canvasElement().buffer()->isAccelerated());
EXPECT_EQ(0u, getGlobalAcceleratedImageBufferCount());
EXPECT_EQ(0, getGlobalGPUMemoryUsage());
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/graphics/ExpensiveCanvasHeuristicParameters.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698