Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_GL_GL_SURFACE_H_ | 5 #ifndef UI_GL_GL_SURFACE_H_ |
| 6 #define UI_GL_GL_SURFACE_H_ | 6 #define UI_GL_GL_SURFACE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 99 // Get the platfrom specific configuration for this surface, if available. | 99 // Get the platfrom specific configuration for this surface, if available. |
| 100 virtual void* GetConfig(); | 100 virtual void* GetConfig(); |
| 101 | 101 |
| 102 // Get the GL pixel format of the surface, if available. | 102 // Get the GL pixel format of the surface, if available. |
| 103 virtual unsigned GetFormat(); | 103 virtual unsigned GetFormat(); |
| 104 | 104 |
| 105 // Get access to a helper providing time of recent refresh and period | 105 // Get access to a helper providing time of recent refresh and period |
| 106 // of screen refresh. If unavailable, returns NULL. | 106 // of screen refresh. If unavailable, returns NULL. |
| 107 virtual VSyncProvider* GetVSyncProvider(); | 107 virtual VSyncProvider* GetVSyncProvider(); |
| 108 | 108 |
| 109 // Schedule an overlay plane to be shown at swap time. | |
| 110 // |z_order| specifies the stacking order of the plane relative to the | |
| 111 // main framebuffer located at index 0. For the case where there is no | |
| 112 // main framebuffer, overlays may be scheduled at 0, taking its place. | |
| 113 // |transform| specifies how the buffer is to be transformed during | |
| 114 // composition. | |
| 115 // |image| to be presented by the overlay. | |
| 116 // |bounds_rect| specify where it is supposed to be on the screen in pixels. | |
| 117 // |crop_rect| specifies the region within the buffer to be placed inside | |
| 118 // |bounds_rect|. | |
| 119 virtual bool ScheduleOverlayPlane(int z_order, | |
|
achaulk
2014/07/30 18:29:51
We still need a way to get something surface-speci
reveman
2014/07/30 18:56:11
Not sure but it seems like it would be more approp
| |
| 120 OverlayTransform transform, | |
| 121 GLImage* image, | |
| 122 const Rect& bounds_rect, | |
| 123 const RectF& crop_rect); | |
| 124 | |
| 125 // Create a GL surface that renders directly to a view. | 109 // Create a GL surface that renders directly to a view. |
| 126 static scoped_refptr<GLSurface> CreateViewGLSurface( | 110 static scoped_refptr<GLSurface> CreateViewGLSurface( |
| 127 gfx::AcceleratedWidget window); | 111 gfx::AcceleratedWidget window); |
| 128 | 112 |
| 129 // Create a GL surface used for offscreen rendering. | 113 // Create a GL surface used for offscreen rendering. |
| 130 static scoped_refptr<GLSurface> CreateOffscreenGLSurface( | 114 static scoped_refptr<GLSurface> CreateOffscreenGLSurface( |
| 131 const gfx::Size& size); | 115 const gfx::Size& size); |
| 132 | 116 |
| 133 static GLSurface* GetCurrent(); | 117 static GLSurface* GetCurrent(); |
| 134 | 118 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 169 virtual void* GetHandle() OVERRIDE; | 153 virtual void* GetHandle() OVERRIDE; |
| 170 virtual unsigned int GetBackingFrameBufferObject() OVERRIDE; | 154 virtual unsigned int GetBackingFrameBufferObject() OVERRIDE; |
| 171 virtual bool OnMakeCurrent(GLContext* context) OVERRIDE; | 155 virtual bool OnMakeCurrent(GLContext* context) OVERRIDE; |
| 172 virtual bool SetBackbufferAllocation(bool allocated) OVERRIDE; | 156 virtual bool SetBackbufferAllocation(bool allocated) OVERRIDE; |
| 173 virtual void SetFrontbufferAllocation(bool allocated) OVERRIDE; | 157 virtual void SetFrontbufferAllocation(bool allocated) OVERRIDE; |
| 174 virtual void* GetShareHandle() OVERRIDE; | 158 virtual void* GetShareHandle() OVERRIDE; |
| 175 virtual void* GetDisplay() OVERRIDE; | 159 virtual void* GetDisplay() OVERRIDE; |
| 176 virtual void* GetConfig() OVERRIDE; | 160 virtual void* GetConfig() OVERRIDE; |
| 177 virtual unsigned GetFormat() OVERRIDE; | 161 virtual unsigned GetFormat() OVERRIDE; |
| 178 virtual VSyncProvider* GetVSyncProvider() OVERRIDE; | 162 virtual VSyncProvider* GetVSyncProvider() OVERRIDE; |
| 179 virtual bool ScheduleOverlayPlane(int z_order, | |
| 180 OverlayTransform transform, | |
| 181 GLImage* image, | |
| 182 const Rect& bounds_rect, | |
| 183 const RectF& crop_rect) OVERRIDE; | |
| 184 | 163 |
| 185 GLSurface* surface() const { return surface_.get(); } | 164 GLSurface* surface() const { return surface_.get(); } |
| 186 | 165 |
| 187 protected: | 166 protected: |
| 188 virtual ~GLSurfaceAdapter(); | 167 virtual ~GLSurfaceAdapter(); |
| 189 | 168 |
| 190 private: | 169 private: |
| 191 scoped_refptr<GLSurface> surface_; | 170 scoped_refptr<GLSurface> surface_; |
| 192 | 171 |
| 193 DISALLOW_COPY_AND_ASSIGN(GLSurfaceAdapter); | 172 DISALLOW_COPY_AND_ASSIGN(GLSurfaceAdapter); |
| 194 }; | 173 }; |
| 195 | 174 |
| 196 } // namespace gfx | 175 } // namespace gfx |
| 197 | 176 |
| 198 #endif // UI_GL_GL_SURFACE_H_ | 177 #endif // UI_GL_GL_SURFACE_H_ |
| OLD | NEW |