| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef UI_GFX_OZONE_SURFACE_OZONE_CANVAS_H_ | |
| 6 #define UI_GFX_OZONE_SURFACE_OZONE_CANVAS_H_ | |
| 7 | |
| 8 #include "base/basictypes.h" | |
| 9 #include "base/memory/scoped_ptr.h" | |
| 10 #include "skia/ext/refptr.h" | |
| 11 #include "ui/gfx/gfx_export.h" | |
| 12 | |
| 13 class SkCanvas; | |
| 14 | |
| 15 namespace gfx { | |
| 16 | |
| 17 class Size; | |
| 18 class VSyncProvider; | |
| 19 | |
| 20 // The platform-specific part of an software output. The class is intended | |
| 21 // for use when no EGL/GLES2 acceleration is possible. | |
| 22 // This class owns any bits that the ozone implementation needs freed when | |
| 23 // the software output is destroyed. | |
| 24 class GFX_EXPORT SurfaceOzoneCanvas { | |
| 25 public: | |
| 26 virtual ~SurfaceOzoneCanvas() {} | |
| 27 | |
| 28 // Returns an SkCanvas for drawing on the window. | |
| 29 virtual skia::RefPtr<SkCanvas> GetCanvas() = 0; | |
| 30 | |
| 31 // Attempts to resize the canvas to match the viewport size. After | |
| 32 // resizing, the compositor must call GetCanvas() to get the next | |
| 33 // canvas - this invalidates any previous canvas from GetCanvas(). | |
| 34 virtual void ResizeCanvas(const gfx::Size& viewport_size) = 0; | |
| 35 | |
| 36 // Present the current canvas. After presenting, the compositor must | |
| 37 // call GetCanvas() to get the next canvas - this invalidates any | |
| 38 // previous canvas from GetCanvas(). | |
| 39 // | |
| 40 // The implementation may assume that any pixels outside the damage | |
| 41 // rectangle are unchanged since the previous call to PresentCanvas(). | |
| 42 virtual void PresentCanvas(const gfx::Rect& damage) = 0; | |
| 43 | |
| 44 // Returns a gfx::VsyncProvider for this surface. Note that this may be | |
| 45 // called after we have entered the sandbox so if there are operations (e.g. | |
| 46 // opening a file descriptor providing vsync events) that must be done | |
| 47 // outside of the sandbox, they must have been completed in | |
| 48 // InitializeHardware. Returns an empty scoped_ptr on error. | |
| 49 virtual scoped_ptr<gfx::VSyncProvider> CreateVSyncProvider() = 0; | |
| 50 }; | |
| 51 | |
| 52 } // namespace gfx | |
| 53 | |
| 54 #endif // UI_GFX_OZONE_SURFACE_OZONE_CANVAS_H_ | |
| OLD | NEW |