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 "platform/graphics/CanvasSurfaceLayerBridge.h" | 5 #include "platform/graphics/CanvasSurfaceLayerBridge.h" |
6 | 6 |
7 #include "cc/layers/solid_color_layer.h" | 7 #include "cc/layers/solid_color_layer.h" |
8 #include "platform/graphics/GraphicsLayer.h" | 8 #include "platform/graphics/GraphicsLayer.h" |
9 #include "public/platform/Platform.h" | 9 #include "public/platform/Platform.h" |
10 #include "public/platform/WebCompositorSupport.h" | 10 #include "public/platform/WebCompositorSupport.h" |
11 #include "public/platform/WebLayer.h" | 11 #include "public/platform/WebLayer.h" |
| 12 #include "wtf/PtrUtil.h" |
12 | 13 |
13 namespace blink { | 14 namespace blink { |
14 | 15 |
15 CanvasSurfaceLayerBridge::CanvasSurfaceLayerBridge() | 16 CanvasSurfaceLayerBridge::CanvasSurfaceLayerBridge() |
16 { | 17 { |
17 m_solidColorLayer = cc::SolidColorLayer::Create(); | 18 m_solidColorLayer = cc::SolidColorLayer::Create(); |
18 m_solidColorLayer->SetBackgroundColor(SK_ColorBLUE); | 19 m_solidColorLayer->SetBackgroundColor(SK_ColorBLUE); |
19 m_webLayer = adoptPtr(Platform::current()->compositorSupport()->createLayerF
romCCLayer(m_solidColorLayer.get())); | 20 m_webLayer = wrapUnique(Platform::current()->compositorSupport()->createLaye
rFromCCLayer(m_solidColorLayer.get())); |
20 GraphicsLayer::registerContentsLayer(m_webLayer.get()); | 21 GraphicsLayer::registerContentsLayer(m_webLayer.get()); |
21 } | 22 } |
22 | 23 |
23 CanvasSurfaceLayerBridge::~CanvasSurfaceLayerBridge() | 24 CanvasSurfaceLayerBridge::~CanvasSurfaceLayerBridge() |
24 { | 25 { |
25 } | 26 } |
26 | 27 |
27 } | 28 } |
OLD | NEW |