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_WIN_H_ | 5 #ifndef CONTENT_BROWSER_COMPOSITOR_SOFTWARE_OUTPUT_DEVICE_WIN_H_ |
6 #define CONTENT_BROWSER_COMPOSITOR_SOFTWARE_OUTPUT_DEVICE_WIN_H_ | 6 #define CONTENT_BROWSER_COMPOSITOR_SOFTWARE_OUTPUT_DEVICE_WIN_H_ |
7 | 7 |
| 8 #include <stddef.h> |
8 #include <windows.h> | 9 #include <windows.h> |
9 #include <stddef.h> | |
10 | 10 |
| 11 #include <memory> |
11 #include <vector> | 12 #include <vector> |
12 | 13 |
13 #include "base/macros.h" | 14 #include "base/macros.h" |
14 #include "base/memory/scoped_ptr.h" | |
15 #include "cc/output/software_output_device.h" | 15 #include "cc/output/software_output_device.h" |
16 #include "third_party/skia/include/core/SkCanvas.h" | 16 #include "third_party/skia/include/core/SkCanvas.h" |
17 #include "third_party/skia/include/core/SkRefCnt.h" | 17 #include "third_party/skia/include/core/SkRefCnt.h" |
18 | 18 |
19 namespace base { | 19 namespace base { |
20 class SharedMemory; | 20 class SharedMemory; |
21 } | 21 } |
22 | 22 |
23 namespace ui { | 23 namespace ui { |
24 class Compositor; | 24 class Compositor; |
25 } | 25 } |
26 | 26 |
27 namespace content { | 27 namespace content { |
28 class SoftwareOutputDeviceWin; | 28 class SoftwareOutputDeviceWin; |
29 | 29 |
30 class OutputDeviceBacking { | 30 class OutputDeviceBacking { |
31 public: | 31 public: |
32 OutputDeviceBacking(); | 32 OutputDeviceBacking(); |
33 ~OutputDeviceBacking(); | 33 ~OutputDeviceBacking(); |
34 | 34 |
35 void Resized(); | 35 void Resized(); |
36 void RegisterOutputDevice(SoftwareOutputDeviceWin* device); | 36 void RegisterOutputDevice(SoftwareOutputDeviceWin* device); |
37 void UnregisterOutputDevice(SoftwareOutputDeviceWin* device); | 37 void UnregisterOutputDevice(SoftwareOutputDeviceWin* device); |
38 base::SharedMemory* GetSharedMemory(const gfx::Size& size); | 38 base::SharedMemory* GetSharedMemory(const gfx::Size& size); |
39 | 39 |
40 private: | 40 private: |
41 size_t GetMaxByteSize(); | 41 size_t GetMaxByteSize(); |
42 | 42 |
43 std::vector<SoftwareOutputDeviceWin*> devices_; | 43 std::vector<SoftwareOutputDeviceWin*> devices_; |
44 scoped_ptr<base::SharedMemory> backing_; | 44 std::unique_ptr<base::SharedMemory> backing_; |
45 size_t created_byte_size_; | 45 size_t created_byte_size_; |
46 | 46 |
47 DISALLOW_COPY_AND_ASSIGN(OutputDeviceBacking); | 47 DISALLOW_COPY_AND_ASSIGN(OutputDeviceBacking); |
48 }; | 48 }; |
49 | 49 |
50 class SoftwareOutputDeviceWin : public cc::SoftwareOutputDevice { | 50 class SoftwareOutputDeviceWin : public cc::SoftwareOutputDevice { |
51 public: | 51 public: |
52 SoftwareOutputDeviceWin(OutputDeviceBacking* backing, | 52 SoftwareOutputDeviceWin(OutputDeviceBacking* backing, |
53 ui::Compositor* compositor); | 53 ui::Compositor* compositor); |
54 ~SoftwareOutputDeviceWin() override; | 54 ~SoftwareOutputDeviceWin() override; |
(...skipping 12 matching lines...) Expand all Loading... |
67 bool is_hwnd_composited_; | 67 bool is_hwnd_composited_; |
68 OutputDeviceBacking* backing_; | 68 OutputDeviceBacking* backing_; |
69 bool in_paint_; | 69 bool in_paint_; |
70 | 70 |
71 DISALLOW_COPY_AND_ASSIGN(SoftwareOutputDeviceWin); | 71 DISALLOW_COPY_AND_ASSIGN(SoftwareOutputDeviceWin); |
72 }; | 72 }; |
73 | 73 |
74 } // namespace content | 74 } // namespace content |
75 | 75 |
76 #endif // CONTENT_BROWSER_COMPOSITOR_SOFTWARE_OUTPUT_DEVICE_WIN_H_ | 76 #endif // CONTENT_BROWSER_COMPOSITOR_SOFTWARE_OUTPUT_DEVICE_WIN_H_ |
OLD | NEW |