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

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

Issue 2825183002: Plumb CanvasColorParams to canvas image classes (Closed)
Patch Set: Require both runtime flags Created 3 years, 8 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 52
53 Document& GetDocument() { return page_holder_->GetDocument(); } 53 Document& GetDocument() { return page_holder_->GetDocument(); }
54 bool HasLayerAttached(const WebLayer& layer) { 54 bool HasLayerAttached(const WebLayer& layer) {
55 return chrome_client_->HasLayer(layer); 55 return chrome_client_->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(&gl_)), size, 0, 60 WTF::WrapUnique(new FakeWebGraphicsContext3DProvider(&gl_)), size, 0,
61 kNonOpaque, Canvas2DLayerBridge::kForceAccelerationForTesting, 61 kNonOpaque, Canvas2DLayerBridge::kForceAccelerationForTesting,
62 gfx::ColorSpace::CreateSRGB(), false, kN32_SkColorType)); 62 CanvasColorParams()));
63 } 63 }
64 64
65 private: 65 private:
66 Persistent<StubChromeClientForSPv2> chrome_client_; 66 Persistent<StubChromeClientForSPv2> chrome_client_;
67 FakeGLES2Interface gl_; 67 FakeGLES2Interface gl_;
68 std::unique_ptr<DummyPageHolder> page_holder_; 68 std::unique_ptr<DummyPageHolder> page_holder_;
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 19 matching lines...) Expand all
92 92
93 // Fetch the layer associated with the <canvas>, and check that it was 93 // Fetch the layer associated with the <canvas>, and check that it was
94 // correctly configured in the layer tree. 94 // correctly configured in the layer tree.
95 const WebLayer* layer = context->PlatformLayer(); 95 const WebLayer* layer = context->PlatformLayer();
96 ASSERT_TRUE(layer); 96 ASSERT_TRUE(layer);
97 EXPECT_TRUE(HasLayerAttached(*layer)); 97 EXPECT_TRUE(HasLayerAttached(*layer));
98 EXPECT_EQ(WebSize(300, 200), layer->Bounds()); 98 EXPECT_EQ(WebSize(300, 200), layer->Bounds());
99 } 99 }
100 100
101 } // namespace blink 101 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698