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 #ifndef CONTENT_BROWSER_COMPOSITOR_SOFTWARE_OUTPUT_DEVICE_OZONE_H_ | 5 #ifndef CONTENT_BROWSER_COMPOSITOR_SOFTWARE_OUTPUT_DEVICE_OZONE_H_ |
6 #define CONTENT_BROWSER_COMPOSITOR_SOFTWARE_OUTPUT_DEVICE_OZONE_H_ | 6 #define CONTENT_BROWSER_COMPOSITOR_SOFTWARE_OUTPUT_DEVICE_OZONE_H_ |
7 | 7 |
| 8 #include <memory> |
| 9 |
8 #include "base/macros.h" | 10 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | |
10 #include "cc/output/software_output_device.h" | 11 #include "cc/output/software_output_device.h" |
11 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
12 #include "ui/gfx/native_widget_types.h" | 13 #include "ui/gfx/native_widget_types.h" |
13 | 14 |
14 namespace ui { | 15 namespace ui { |
15 class Compositor; | 16 class Compositor; |
16 class SurfaceOzoneCanvas; | 17 class SurfaceOzoneCanvas; |
17 } | 18 } |
18 | 19 |
19 namespace content { | 20 namespace content { |
20 | 21 |
21 // Ozone implementation which relies on software rendering. Ozone will present | 22 // Ozone implementation which relies on software rendering. Ozone will present |
22 // an accelerated widget as a SkCanvas. SoftwareOutputDevice will then use the | 23 // an accelerated widget as a SkCanvas. SoftwareOutputDevice will then use the |
23 // Ozone provided canvas to draw. | 24 // Ozone provided canvas to draw. |
24 class CONTENT_EXPORT SoftwareOutputDeviceOzone | 25 class CONTENT_EXPORT SoftwareOutputDeviceOzone |
25 : public cc::SoftwareOutputDevice { | 26 : public cc::SoftwareOutputDevice { |
26 public: | 27 public: |
27 static scoped_ptr<SoftwareOutputDeviceOzone> Create( | 28 static std::unique_ptr<SoftwareOutputDeviceOzone> Create( |
28 ui::Compositor* compositor); | 29 ui::Compositor* compositor); |
29 ~SoftwareOutputDeviceOzone() override; | 30 ~SoftwareOutputDeviceOzone() override; |
30 | 31 |
31 void Resize(const gfx::Size& viewport_pixel_size, | 32 void Resize(const gfx::Size& viewport_pixel_size, |
32 float scale_factor) override; | 33 float scale_factor) override; |
33 SkCanvas* BeginPaint(const gfx::Rect& damage_rect) override; | 34 SkCanvas* BeginPaint(const gfx::Rect& damage_rect) override; |
34 void EndPaint() override; | 35 void EndPaint() override; |
35 | 36 |
36 private: | 37 private: |
37 explicit SoftwareOutputDeviceOzone(ui::Compositor* compositor); | 38 explicit SoftwareOutputDeviceOzone(ui::Compositor* compositor); |
38 ui::Compositor* compositor_; | 39 ui::Compositor* compositor_; |
39 | 40 |
40 scoped_ptr<ui::SurfaceOzoneCanvas> surface_ozone_; | 41 std::unique_ptr<ui::SurfaceOzoneCanvas> surface_ozone_; |
41 | 42 |
42 DISALLOW_COPY_AND_ASSIGN(SoftwareOutputDeviceOzone); | 43 DISALLOW_COPY_AND_ASSIGN(SoftwareOutputDeviceOzone); |
43 }; | 44 }; |
44 | 45 |
45 } // namespace content | 46 } // namespace content |
46 | 47 |
47 #endif // CONTENT_BROWSER_COMPOSITOR_SOFTWARE_OUTPUT_DEVICE_OZONE_H_ | 48 #endif // CONTENT_BROWSER_COMPOSITOR_SOFTWARE_OUTPUT_DEVICE_OZONE_H_ |
OLD | NEW |