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

Side by Side Diff: third_party/WebKit/Source/core/paint/HTMLCanvasPainterTest.cpp

Issue 2212163002: Add some plumbing for the color management of canvases (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase again Created 4 years, 3 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "core/paint/HTMLCanvasPainter.h" 5 #include "core/paint/HTMLCanvasPainter.h"
6 6
7 #include "core/frame/FrameView.h" 7 #include "core/frame/FrameView.h"
8 #include "core/frame/Settings.h" 8 #include "core/frame/Settings.h"
9 #include "core/html/HTMLCanvasElement.h" 9 #include "core/html/HTMLCanvasElement.h"
10 #include "core/html/canvas/CanvasContextCreationAttributes.h" 10 #include "core/html/canvas/CanvasContextCreationAttributes.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 m_featuresBackup.restore(); 49 m_featuresBackup.restore();
50 } 50 }
51 51
52 Document& document() { return m_pageHolder->document(); } 52 Document& document() { return m_pageHolder->document(); }
53 bool hasLayerAttached(const WebLayer& layer) { return m_chromeClient->hasLay er(layer); } 53 bool hasLayerAttached(const WebLayer& layer) { return m_chromeClient->hasLay er(layer); }
54 54
55 PassRefPtr<Canvas2DLayerBridge> makeCanvas2DLayerBridge(const IntSize& size) 55 PassRefPtr<Canvas2DLayerBridge> makeCanvas2DLayerBridge(const IntSize& size)
56 { 56 {
57 return adoptRef(new Canvas2DLayerBridge( 57 return adoptRef(new Canvas2DLayerBridge(
58 wrapUnique(new FakeWebGraphicsContext3DProvider(&m_gl)), 58 wrapUnique(new FakeWebGraphicsContext3DProvider(&m_gl)),
59 size, 0, NonOpaque, Canvas2DLayerBridge::ForceAccelerationForTesting )); 59 size, 0, NonOpaque, Canvas2DLayerBridge::ForceAccelerationForTesting ,
60 nullptr));
60 } 61 }
61 62
62 private: 63 private:
63 RuntimeEnabledFeatures::Backup m_featuresBackup; 64 RuntimeEnabledFeatures::Backup m_featuresBackup;
64 Persistent<StubChromeClientForSPv2> m_chromeClient; 65 Persistent<StubChromeClientForSPv2> m_chromeClient;
65 FakeGLES2Interface m_gl; 66 FakeGLES2Interface m_gl;
66 std::unique_ptr<DummyPageHolder> m_pageHolder; 67 std::unique_ptr<DummyPageHolder> m_pageHolder;
67 }; 68 };
68 69
69 INSTANTIATE_TEST_CASE_P(, HTMLCanvasPainterTestForSPv2, ::testing::Values( 70 INSTANTIATE_TEST_CASE_P(, HTMLCanvasPainterTestForSPv2, ::testing::Values(
(...skipping 19 matching lines...) Expand all
89 90
90 // Fetch the layer associated with the <canvas>, and check that it was 91 // Fetch the layer associated with the <canvas>, and check that it was
91 // correctly configured in the layer tree. 92 // correctly configured in the layer tree.
92 const WebLayer* layer = context->platformLayer(); 93 const WebLayer* layer = context->platformLayer();
93 ASSERT_TRUE(layer); 94 ASSERT_TRUE(layer);
94 EXPECT_TRUE(hasLayerAttached(*layer)); 95 EXPECT_TRUE(hasLayerAttached(*layer));
95 EXPECT_EQ(WebSize(300, 200), layer->bounds()); 96 EXPECT_EQ(WebSize(300, 200), layer->bounds());
96 } 97 }
97 98
98 } // namespace blink 99 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698