OLD | NEW |
---|---|
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_OZONE_PUBLIC_SURFACE_FACTORY_OZONE_H_ | 5 #ifndef UI_OZONE_PUBLIC_SURFACE_FACTORY_OZONE_H_ |
6 #define UI_OZONE_PUBLIC_SURFACE_FACTORY_OZONE_H_ | 6 #define UI_OZONE_PUBLIC_SURFACE_FACTORY_OZONE_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/native_library.h" | 10 #include "base/native_library.h" |
11 #include "ui/gfx/geometry/point.h" | 11 #include "ui/gfx/geometry/point.h" |
12 #include "ui/gfx/geometry/rect.h" | 12 #include "ui/gfx/geometry/rect.h" |
13 #include "ui/gfx/native_widget_types.h" | 13 #include "ui/gfx/native_widget_types.h" |
14 #include "ui/gfx/overlay_transform.h" | 14 #include "ui/gfx/overlay_transform.h" |
15 #include "ui/gfx/rect.h" | 15 #include "ui/gfx/rect.h" |
16 #include "ui/ozone/ozone_base_export.h" | 16 #include "ui/ozone/ozone_base_export.h" |
17 #include "ui/ozone/public/native_pixmap.h" | |
alexst (slow to review)
2014/07/04 01:31:49
Can we forward declare this instead?
spang
2014/07/04 14:03:15
probably not
achaulk
2014/07/04 15:26:01
I didn't think so either, but apparently it does w
| |
17 | 18 |
18 class SkBitmap; | 19 class SkBitmap; |
19 class SkCanvas; | 20 class SkCanvas; |
20 | 21 |
21 namespace ui { | 22 namespace ui { |
22 | 23 |
23 typedef intptr_t NativeBufferOzone; | |
24 class OverlayCandidatesOzone; | 24 class OverlayCandidatesOzone; |
25 class SurfaceOzoneCanvas; | 25 class SurfaceOzoneCanvas; |
26 class SurfaceOzoneEGL; | 26 class SurfaceOzoneEGL; |
27 | 27 |
28 // The Ozone interface allows external implementations to hook into Chromium to | 28 // The Ozone interface allows external implementations to hook into Chromium to |
29 // provide a system specific implementation. The Ozone interface supports two | 29 // provide a system specific implementation. The Ozone interface supports two |
30 // drawing modes: 1) accelerated drawing through EGL and 2) software drawing | 30 // drawing modes: 1) accelerated drawing through EGL and 2) software drawing |
31 // through Skia. | 31 // through Skia. |
32 // | 32 // |
33 // If you want to paint on a window with ozone, you need to create a | 33 // If you want to paint on a window with ozone, you need to create a |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
127 // used to select a display configuration. Note that all properties should be | 127 // used to select a display configuration. Note that all properties should be |
128 // immediately followed by the corresponding desired value and array should be | 128 // immediately followed by the corresponding desired value and array should be |
129 // terminated with EGL_NONE. Ownership of the array is not transferred to | 129 // terminated with EGL_NONE. Ownership of the array is not transferred to |
130 // caller. desired_list contains list of desired EGL properties and values. | 130 // caller. desired_list contains list of desired EGL properties and values. |
131 virtual const int32* GetEGLSurfaceProperties(const int32* desired_list); | 131 virtual const int32* GetEGLSurfaceProperties(const int32* desired_list); |
132 | 132 |
133 // Get the hal struct to check for overlay support. | 133 // Get the hal struct to check for overlay support. |
134 virtual OverlayCandidatesOzone* GetOverlayCandidates( | 134 virtual OverlayCandidatesOzone* GetOverlayCandidates( |
135 gfx::AcceleratedWidget w); | 135 gfx::AcceleratedWidget w); |
136 | 136 |
137 // Sets the overlay plane to switch to at the next page flip. | 137 // Cleate a single native buffer to be used for overlay planes. |
138 // |plane_z_order| specifies the stacking order of the plane relative to the | 138 virtual scoped_refptr<ui::NativePixmap> CreateNativePixmap( |
alexst (slow to review)
2014/07/04 01:31:49
nit: We are already in the ui namespace.
| |
139 // main framebuffer located at index 0. | 139 gfx::Size size, |
140 // |plane_transform| specifies how the buffer is to be transformed during. | 140 BufferFormat format); |
141 // composition. | |
142 // |buffer| to be presented by the overlay. | |
143 // |display_bounds| specify where it is supposed to be on the screen. | |
144 // |crop_rect| specifies the region within the buffer to be placed inside | |
145 // |display_bounds|. | |
146 virtual void ScheduleOverlayPlane(gfx::AcceleratedWidget w, | |
147 int plane_z_order, | |
148 gfx::OverlayTransform plane_transform, | |
149 ui::NativeBufferOzone buffer, | |
150 const gfx::Rect& display_bounds, | |
151 gfx::RectF crop_rect); | |
152 | 141 |
153 // Cleate a single native buffer to be used for overlay planes. | 142 // Returns true if overlays can be shown at z-index 0, replacing the main |
154 virtual ui::NativeBufferOzone CreateNativeBuffer(gfx::Size size, | 143 // surface. Combined with surfaceless extensions, it allows for an |
155 BufferFormat format); | 144 // overlay-only mode. |
145 virtual bool CanShowPrimaryPlaneAsOverlay(); | |
156 | 146 |
157 private: | 147 private: |
158 static SurfaceFactoryOzone* impl_; // not owned | 148 static SurfaceFactoryOzone* impl_; // not owned |
159 }; | 149 }; |
160 | 150 |
161 } // namespace ui | 151 } // namespace ui |
162 | 152 |
163 #endif // UI_OZONE_PUBLIC_SURFACE_FACTORY_OZONE_H_ | 153 #endif // UI_OZONE_PUBLIC_SURFACE_FACTORY_OZONE_H_ |
OLD | NEW |