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

Side by Side Diff: third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp

Issue 2144573003: Temporarily disabling 2d canvas getImageData optimization (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix test 4 realz Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/graphics/ExpensiveCanvasHeuristicParameters.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "modules/canvas2d/CanvasRenderingContext2D.h" 5 #include "modules/canvas2d/CanvasRenderingContext2D.h"
6 6
7 #include "core/fetch/MemoryCache.h" 7 #include "core/fetch/MemoryCache.h"
8 #include "core/frame/FrameView.h" 8 #include "core/frame/FrameView.h"
9 #include "core/frame/ImageBitmap.h" 9 #include "core/frame/ImageBitmap.h"
10 #include "core/html/HTMLCanvasElement.h" 10 #include "core/html/HTMLCanvasElement.h"
(...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after
776 canvasElement().createImageBufferUsingSurfaceForTesting(std::move(surface)); 776 canvasElement().createImageBufferUsingSurfaceForTesting(std::move(surface));
777 777
778 EXPECT_TRUE(bridge->isAccelerated()); 778 EXPECT_TRUE(bridge->isAccelerated());
779 EXPECT_EQ(1u, getGlobalAcceleratedImageBufferCount()); 779 EXPECT_EQ(1u, getGlobalAcceleratedImageBufferCount());
780 EXPECT_EQ(720000, getGlobalGPUMemoryUsage()); 780 EXPECT_EQ(720000, getGlobalGPUMemoryUsage());
781 781
782 TrackExceptionState exceptionState; 782 TrackExceptionState exceptionState;
783 context2d()->getImageData(0, 0, 1, 1, exceptionState); 783 context2d()->getImageData(0, 0, 1, 1, exceptionState);
784 784
785 EXPECT_FALSE(exceptionState.hadException()); 785 EXPECT_FALSE(exceptionState.hadException());
786 EXPECT_FALSE(bridge->isAccelerated()); 786 if (ExpensiveCanvasHeuristicParameters::GetImageDataForcesNoAcceleration) {
787 EXPECT_EQ(0u, getGlobalAcceleratedImageBufferCount()); 787 EXPECT_FALSE(bridge->isAccelerated());
788 EXPECT_EQ(0, getGlobalGPUMemoryUsage()); 788 EXPECT_EQ(0u, getGlobalAcceleratedImageBufferCount());
789 EXPECT_EQ(0, getGlobalGPUMemoryUsage());
790 } else {
791 EXPECT_TRUE(bridge->isAccelerated());
792 EXPECT_EQ(1u, getGlobalAcceleratedImageBufferCount());
793 EXPECT_EQ(720000, getGlobalGPUMemoryUsage());
794 }
789 795
790 // Restore global state to prevent side-effects on other tests 796 // Restore global state to prevent side-effects on other tests
791 RuntimeEnabledFeatures::setCanvas2dFixedRenderingModeEnabled(savedFixedRende ringMode); 797 RuntimeEnabledFeatures::setCanvas2dFixedRenderingModeEnabled(savedFixedRende ringMode);
792 } 798 }
793 799
794 } // namespace blink 800 } // namespace blink
OLDNEW
« 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