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 UI_GFX_OZONE_SURFACE_OZONE_CANVAS_H_ | 5 #ifndef UI_GFX_OZONE_SURFACE_OZONE_CANVAS_H_ |
6 #define UI_GFX_OZONE_SURFACE_OZONE_CANVAS_H_ | 6 #define UI_GFX_OZONE_SURFACE_OZONE_CANVAS_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "skia/ext/refptr.h" | 10 #include "skia/ext/refptr.h" |
(...skipping 10 matching lines...) Expand all Loading... | |
21 // for use when no EGL/GLES2 acceleration is possible. | 21 // for use when no EGL/GLES2 acceleration is possible. |
22 // This class owns any bits that the ozone implementation needs freed when | 22 // This class owns any bits that the ozone implementation needs freed when |
23 // the software output is destroyed. | 23 // the software output is destroyed. |
24 class GFX_EXPORT SurfaceOzoneCanvas { | 24 class GFX_EXPORT SurfaceOzoneCanvas { |
25 public: | 25 public: |
26 virtual ~SurfaceOzoneCanvas() {} | 26 virtual ~SurfaceOzoneCanvas() {} |
27 | 27 |
28 // Returns an SkCanvas for drawing on the window. | 28 // Returns an SkCanvas for drawing on the window. |
29 virtual skia::RefPtr<SkCanvas> GetCanvas() = 0; | 29 virtual skia::RefPtr<SkCanvas> GetCanvas() = 0; |
30 | 30 |
31 // Attempts to resize the canvas to match the viewport size. Returns true if | 31 // Attempts to resize the canvas to match the viewport size. After |
32 // resizing was successful, otherwise false (platforms may require a fixed | 32 // resizing, the compositor must call GetCanvas() to get the next |
33 // size canvas). After resizing, the compositor must call GetCanvas() to get | 33 // canvas. |
34 // the next canvas. | 34 virtual void ResizeCanvas(const gfx::Size& viewport_size) = 0; |
rjkroege
2014/04/23 22:29:32
what was your reasoning for removing the bool retu
| |
35 virtual bool ResizeCanvas(const gfx::Size& viewport_size) = 0; | |
36 | 35 |
37 // Present the current canvas. After presenting, the compositor must call | 36 // Present the current canvas. After presenting, the compositor must |
38 // GetCanvas() to get the next canvas. | 37 // call GetCanvas() to get the next canvas. |
rjkroege
2014/04/23 22:29:32
say what damage is and its semantics please? Can I
| |
39 virtual bool PresentCanvas() = 0; | 38 virtual void PresentCanvas(const gfx::Rect& damage) = 0; |
40 | 39 |
41 // Returns a gfx::VsyncProvider for this surface. Note that this may be | 40 // Returns a gfx::VsyncProvider for this surface. Note that this may be |
42 // called after we have entered the sandbox so if there are operations (e.g. | 41 // called after we have entered the sandbox so if there are operations (e.g. |
43 // opening a file descriptor providing vsync events) that must be done | 42 // opening a file descriptor providing vsync events) that must be done |
44 // outside of the sandbox, they must have been completed in | 43 // outside of the sandbox, they must have been completed in |
45 // InitializeHardware. Returns an empty scoped_ptr on error. | 44 // InitializeHardware. Returns an empty scoped_ptr on error. |
46 virtual scoped_ptr<gfx::VSyncProvider> CreateVSyncProvider() = 0; | 45 virtual scoped_ptr<gfx::VSyncProvider> CreateVSyncProvider() = 0; |
47 }; | 46 }; |
48 | 47 |
49 } // namespace gfx | 48 } // namespace gfx |
50 | 49 |
51 #endif // UI_GFX_OZONE_SURFACE_OZONE_CANVAS_H_ | 50 #endif // UI_GFX_OZONE_SURFACE_OZONE_CANVAS_H_ |
OLD | NEW |