Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 , nullptr)); |
|
Stephen White
2016/08/12 19:48:31
Nit: maybe wrap this line at 80 cols, since the pr
Justin Novosad
2016/08/12 20:08:49
Done.
| |
| 60 } | 60 } |
| 61 | 61 |
| 62 private: | 62 private: |
| 63 RuntimeEnabledFeatures::Backup m_featuresBackup; | 63 RuntimeEnabledFeatures::Backup m_featuresBackup; |
| 64 Persistent<StubChromeClientForSPv2> m_chromeClient; | 64 Persistent<StubChromeClientForSPv2> m_chromeClient; |
| 65 FakeGLES2Interface m_gl; | 65 FakeGLES2Interface m_gl; |
| 66 std::unique_ptr<DummyPageHolder> m_pageHolder; | 66 std::unique_ptr<DummyPageHolder> m_pageHolder; |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 INSTANTIATE_TEST_CASE_P(, HTMLCanvasPainterTestForSPv2, ::testing::Values( | 69 INSTANTIATE_TEST_CASE_P(, HTMLCanvasPainterTestForSPv2, ::testing::Values( |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 89 | 89 |
| 90 // Fetch the layer associated with the <canvas>, and check that it was | 90 // Fetch the layer associated with the <canvas>, and check that it was |
| 91 // correctly configured in the layer tree. | 91 // correctly configured in the layer tree. |
| 92 const WebLayer* layer = context->platformLayer(); | 92 const WebLayer* layer = context->platformLayer(); |
| 93 ASSERT_TRUE(layer); | 93 ASSERT_TRUE(layer); |
| 94 EXPECT_TRUE(hasLayerAttached(*layer)); | 94 EXPECT_TRUE(hasLayerAttached(*layer)); |
| 95 EXPECT_EQ(WebSize(300, 200), layer->bounds()); | 95 EXPECT_EQ(WebSize(300, 200), layer->bounds()); |
| 96 } | 96 } |
| 97 | 97 |
| 98 } // namespace blink | 98 } // namespace blink |
| OLD | NEW |