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

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

Issue 2660393002: Use gfx::ColorSpace instead of SkColorSpace in Blink (Closed)
Patch Set: Rebase (again) 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 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 } 51 }
52 52
53 Document& document() { return m_pageHolder->document(); } 53 Document& document() { return m_pageHolder->document(); }
54 bool hasLayerAttached(const WebLayer& layer) { 54 bool hasLayerAttached(const WebLayer& layer) {
55 return m_chromeClient->hasLayer(layer); 55 return m_chromeClient->hasLayer(layer);
56 } 56 }
57 57
58 PassRefPtr<Canvas2DLayerBridge> makeCanvas2DLayerBridge(const IntSize& size) { 58 PassRefPtr<Canvas2DLayerBridge> makeCanvas2DLayerBridge(const IntSize& size) {
59 return adoptRef(new Canvas2DLayerBridge( 59 return adoptRef(new Canvas2DLayerBridge(
60 WTF::wrapUnique(new FakeWebGraphicsContext3DProvider(&m_gl)), size, 0, 60 WTF::wrapUnique(new FakeWebGraphicsContext3DProvider(&m_gl)), size, 0,
61 NonOpaque, Canvas2DLayerBridge::ForceAccelerationForTesting, nullptr, 61 NonOpaque, Canvas2DLayerBridge::ForceAccelerationForTesting,
62 kN32_SkColorType)); 62 gfx::ColorSpace::CreateSRGB(), false, kN32_SkColorType));
63 } 63 }
64 64
65 private: 65 private:
66 Persistent<StubChromeClientForSPv2> m_chromeClient; 66 Persistent<StubChromeClientForSPv2> m_chromeClient;
67 FakeGLES2Interface m_gl; 67 FakeGLES2Interface m_gl;
68 std::unique_ptr<DummyPageHolder> m_pageHolder; 68 std::unique_ptr<DummyPageHolder> m_pageHolder;
69 }; 69 };
70 70
71 INSTANTIATE_TEST_CASE_P(All, HTMLCanvasPainterTestForSPv2, ::testing::Bool()); 71 INSTANTIATE_TEST_CASE_P(All, HTMLCanvasPainterTestForSPv2, ::testing::Bool());
72 72
(...skipping 18 matching lines...) Expand all
91 91
92 // Fetch the layer associated with the <canvas>, and check that it was 92 // Fetch the layer associated with the <canvas>, and check that it was
93 // correctly configured in the layer tree. 93 // correctly configured in the layer tree.
94 const WebLayer* layer = context->platformLayer(); 94 const WebLayer* layer = context->platformLayer();
95 ASSERT_TRUE(layer); 95 ASSERT_TRUE(layer);
96 EXPECT_TRUE(hasLayerAttached(*layer)); 96 EXPECT_TRUE(hasLayerAttached(*layer));
97 EXPECT_EQ(WebSize(300, 200), layer->bounds()); 97 EXPECT_EQ(WebSize(300, 200), layer->bounds());
98 } 98 }
99 99
100 } // namespace blink 100 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698