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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/RecordingImageBufferSurfaceTest.cpp

Issue 2123623002: Reland: Make 2D canvas disable gpu acceleration when getImageData is called (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix tests 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
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 "platform/graphics/RecordingImageBufferSurface.h" 5 #include "platform/graphics/RecordingImageBufferSurface.h"
6 6
7 #include "platform/graphics/GraphicsContext.h" 7 #include "platform/graphics/GraphicsContext.h"
8 #include "platform/graphics/ImageBuffer.h" 8 #include "platform/graphics/ImageBuffer.h"
9 #include "platform/graphics/ImageBufferClient.h" 9 #include "platform/graphics/ImageBufferClient.h"
10 #include "platform/graphics/UnacceleratedImageBufferSurface.h" 10 #include "platform/graphics/UnacceleratedImageBufferSurface.h"
(...skipping 20 matching lines...) Expand all
31 : m_isDirty(false) 31 : m_isDirty(false)
32 , m_imageBuffer(imageBuffer) 32 , m_imageBuffer(imageBuffer)
33 , m_frameCount(0) 33 , m_frameCount(0)
34 { } 34 { }
35 35
36 ~FakeImageBufferClient() override { } 36 ~FakeImageBufferClient() override { }
37 37
38 // ImageBufferClient implementation 38 // ImageBufferClient implementation
39 void notifySurfaceInvalid() override { } 39 void notifySurfaceInvalid() override { }
40 bool isDirty() override { return m_isDirty; } 40 bool isDirty() override { return m_isDirty; }
41 void didDisableAcceleration() override { }
41 void didFinalizeFrame() override 42 void didFinalizeFrame() override
42 { 43 {
43 if (m_isDirty) { 44 if (m_isDirty) {
44 Platform::current()->currentThread()->removeTaskObserver(this); 45 Platform::current()->currentThread()->removeTaskObserver(this);
45 m_isDirty = false; 46 m_isDirty = false;
46 } 47 }
47 ++m_frameCount; 48 ++m_frameCount;
48 } 49 }
49 50
50 // TaskObserver implementation 51 // TaskObserver implementation
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 expectDisplayListEnabled(true); 385 expectDisplayListEnabled(true);
385 } 386 }
386 387
387 TEST_F(RecordingImageBufferSurfaceTest, testClearRect) 388 TEST_F(RecordingImageBufferSurfaceTest, testClearRect)
388 { 389 {
389 CALL_TEST_TASK_WRAPPER(testClearRect); 390 CALL_TEST_TASK_WRAPPER(testClearRect);
390 expectDisplayListEnabled(true); 391 expectDisplayListEnabled(true);
391 } 392 }
392 393
393 } // namespace blink 394 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698