Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(266)

Side by Side Diff: content/browser/compositor/software_output_device_ozone.h

Issue 1575943002: ozone: gracefully handle SoftwareOutputDeviceOzoneTest.CheckCorrectResizeBehavior (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "base/macros.h" 8 #include "base/macros.h"
9 #include "cc/output/software_output_device.h" 9 #include "cc/output/software_output_device.h"
10 #include "content/common/content_export.h" 10 #include "content/common/content_export.h"
11 #include "ui/gfx/native_widget_types.h" 11 #include "ui/gfx/native_widget_types.h"
12 12
13 namespace ui { 13 namespace ui {
14 class Compositor; 14 class Compositor;
15 class SurfaceOzoneCanvas; 15 class SurfaceOzoneCanvas;
16 } 16 }
17 17
18 namespace content { 18 namespace content {
19 19
20 // Ozone implementation which relies on software rendering. Ozone will present 20 // Ozone implementation which relies on software rendering. Ozone will present
21 // an accelerated widget as a SkCanvas. SoftwareOutputDevice will then use the 21 // an accelerated widget as a SkCanvas. SoftwareOutputDevice will then use the
22 // Ozone provided canvas to draw. 22 // Ozone provided canvas to draw.
23 class CONTENT_EXPORT SoftwareOutputDeviceOzone 23 class CONTENT_EXPORT SoftwareOutputDeviceOzone
24 : public cc::SoftwareOutputDevice { 24 : public cc::SoftwareOutputDevice {
25 public: 25 public:
26 explicit SoftwareOutputDeviceOzone(ui::Compositor* compositor); 26 static scoped_ptr<SoftwareOutputDeviceOzone> Create(
27 ui::Compositor* compositor);
27 ~SoftwareOutputDeviceOzone() override; 28 ~SoftwareOutputDeviceOzone() override;
28 29
29 void Resize(const gfx::Size& viewport_pixel_size, 30 void Resize(const gfx::Size& viewport_pixel_size,
30 float scale_factor) override; 31 float scale_factor) override;
31 SkCanvas* BeginPaint(const gfx::Rect& damage_rect) override; 32 SkCanvas* BeginPaint(const gfx::Rect& damage_rect) override;
32 void EndPaint() override; 33 void EndPaint() override;
33 34
34 private: 35 private:
36 explicit SoftwareOutputDeviceOzone(ui::Compositor* compositor);
35 ui::Compositor* compositor_; 37 ui::Compositor* compositor_;
36 38
37 scoped_ptr<ui::SurfaceOzoneCanvas> surface_ozone_; 39 scoped_ptr<ui::SurfaceOzoneCanvas> surface_ozone_;
38 40
39 DISALLOW_COPY_AND_ASSIGN(SoftwareOutputDeviceOzone); 41 DISALLOW_COPY_AND_ASSIGN(SoftwareOutputDeviceOzone);
40 }; 42 };
41 43
42 } // namespace content 44 } // namespace content
43 45
44 #endif // CONTENT_BROWSER_COMPOSITOR_SOFTWARE_OUTPUT_DEVICE_OZONE_H_ 46 #endif // CONTENT_BROWSER_COMPOSITOR_SOFTWARE_OUTPUT_DEVICE_OZONE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698