OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/memory/scoped_ptr.h" | |
6 #include "content/browser/compositor/software_output_device_ozone.h" | 5 #include "content/browser/compositor/software_output_device_ozone.h" |
| 6 |
| 7 #include <memory> |
| 8 |
7 #include "ui/compositor/compositor.h" | 9 #include "ui/compositor/compositor.h" |
8 #include "ui/gfx/skia_util.h" | 10 #include "ui/gfx/skia_util.h" |
9 #include "ui/gfx/vsync_provider.h" | 11 #include "ui/gfx/vsync_provider.h" |
10 #include "ui/ozone/public/ozone_platform.h" | 12 #include "ui/ozone/public/ozone_platform.h" |
11 #include "ui/ozone/public/surface_factory_ozone.h" | 13 #include "ui/ozone/public/surface_factory_ozone.h" |
12 #include "ui/ozone/public/surface_ozone_canvas.h" | 14 #include "ui/ozone/public/surface_ozone_canvas.h" |
13 | 15 |
14 namespace content { | 16 namespace content { |
15 | 17 |
16 // static | 18 // static |
17 scoped_ptr<SoftwareOutputDeviceOzone> SoftwareOutputDeviceOzone::Create( | 19 std::unique_ptr<SoftwareOutputDeviceOzone> SoftwareOutputDeviceOzone::Create( |
18 ui::Compositor* compositor) { | 20 ui::Compositor* compositor) { |
19 scoped_ptr<SoftwareOutputDeviceOzone> result( | 21 std::unique_ptr<SoftwareOutputDeviceOzone> result( |
20 new SoftwareOutputDeviceOzone(compositor)); | 22 new SoftwareOutputDeviceOzone(compositor)); |
21 if (!result->surface_ozone_) | 23 if (!result->surface_ozone_) |
22 return nullptr; | 24 return nullptr; |
23 return result; | 25 return result; |
24 } | 26 } |
25 | 27 |
26 SoftwareOutputDeviceOzone::SoftwareOutputDeviceOzone(ui::Compositor* compositor) | 28 SoftwareOutputDeviceOzone::SoftwareOutputDeviceOzone(ui::Compositor* compositor) |
27 : compositor_(compositor) { | 29 : compositor_(compositor) { |
28 ui::SurfaceFactoryOzone* factory = | 30 ui::SurfaceFactoryOzone* factory = |
29 ui::OzonePlatform::GetInstance()->GetSurfaceFactoryOzone(); | 31 ui::OzonePlatform::GetInstance()->GetSurfaceFactoryOzone(); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 return SoftwareOutputDevice::BeginPaint(damage_rect); | 64 return SoftwareOutputDevice::BeginPaint(damage_rect); |
63 } | 65 } |
64 | 66 |
65 void SoftwareOutputDeviceOzone::EndPaint() { | 67 void SoftwareOutputDeviceOzone::EndPaint() { |
66 SoftwareOutputDevice::EndPaint(); | 68 SoftwareOutputDevice::EndPaint(); |
67 | 69 |
68 surface_ozone_->PresentCanvas(damage_rect_); | 70 surface_ozone_->PresentCanvas(damage_rect_); |
69 } | 71 } |
70 | 72 |
71 } // namespace content | 73 } // namespace content |
OLD | NEW |