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

Side by Side Diff: ui/gl/gl_surface.h

Issue 2067503003: Add a new command buffer function glScheduleCALayerInUseQueryCHROMIUM. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Include gl_image.h Created 4 years, 6 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
« no previous file with comments | « ui/gl/gl_enums_implementation_autogen.h ('k') | ui/gl/gl_surface.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/callback.h" 10 #include "base/callback.h"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
13 #include "build/build_config.h" 13 #include "build/build_config.h"
14 #include "ui/gfx/geometry/rect.h" 14 #include "ui/gfx/geometry/rect.h"
15 #include "ui/gfx/geometry/rect_f.h" 15 #include "ui/gfx/geometry/rect_f.h"
16 #include "ui/gfx/geometry/size.h" 16 #include "ui/gfx/geometry/size.h"
17 #include "ui/gfx/native_widget_types.h" 17 #include "ui/gfx/native_widget_types.h"
18 #include "ui/gfx/overlay_transform.h" 18 #include "ui/gfx/overlay_transform.h"
19 #include "ui/gfx/swap_result.h" 19 #include "ui/gfx/swap_result.h"
20 #include "ui/gl/gl_export.h" 20 #include "ui/gl/gl_export.h"
21 #include "ui/gl/gl_image.h"
21 #include "ui/gl/gl_implementation.h" 22 #include "ui/gl/gl_implementation.h"
22 23
23 namespace gfx { 24 namespace gfx {
24 class Transform; 25 class Transform;
25 class VSyncProvider; 26 class VSyncProvider;
26 } 27 }
27 28
28 namespace gl { 29 namespace gl {
29 30
30 class GLContext; 31 class GLContext;
31 class GLImage;
32 32
33 // Encapsulates a surface that can be rendered to with GL, hiding platform 33 // Encapsulates a surface that can be rendered to with GL, hiding platform
34 // specific management. 34 // specific management.
35 class GL_EXPORT GLSurface : public base::RefCounted<GLSurface> { 35 class GL_EXPORT GLSurface : public base::RefCounted<GLSurface> {
36 public: 36 public:
37 GLSurface(); 37 GLSurface();
38 38
39 // Minimum bit depth of surface. 39 // Minimum bit depth of surface.
40 enum Format { 40 enum Format {
41 SURFACE_ARGB8888, 41 SURFACE_ARGB8888,
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 const gfx::RectF& contents_rect, 177 const gfx::RectF& contents_rect,
178 float opacity, 178 float opacity,
179 unsigned background_color, 179 unsigned background_color,
180 unsigned edge_aa_mask, 180 unsigned edge_aa_mask,
181 const gfx::RectF& rect, 181 const gfx::RectF& rect,
182 bool is_clipped, 182 bool is_clipped,
183 const gfx::RectF& clip_rect, 183 const gfx::RectF& clip_rect,
184 const gfx::Transform& transform, 184 const gfx::Transform& transform,
185 int sorting_content_id, 185 int sorting_content_id,
186 unsigned filter); 186 unsigned filter);
187 struct GL_EXPORT CALayerInUseQuery {
188 CALayerInUseQuery();
189 explicit CALayerInUseQuery(const CALayerInUseQuery&);
190 ~CALayerInUseQuery();
191 unsigned texture = 0;
192 scoped_refptr<GLImage> image;
193 };
194 virtual void ScheduleCALayerInUseQuery(
195 std::vector<CALayerInUseQuery> queries);
187 196
188 virtual bool IsSurfaceless() const; 197 virtual bool IsSurfaceless() const;
189 198
190 virtual bool FlipsVertically() const; 199 virtual bool FlipsVertically() const;
191 200
192 // Returns true if SwapBuffers or PostSubBuffers causes a flip, such that 201 // Returns true if SwapBuffers or PostSubBuffers causes a flip, such that
193 // the next buffer may be 2 frames old. 202 // the next buffer may be 2 frames old.
194 virtual bool BuffersFlipped() const; 203 virtual bool BuffersFlipped() const;
195 204
196 static GLSurface* GetCurrent(); 205 static GLSurface* GetCurrent();
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 282
274 // Wraps GLSurface in scoped_refptr and tries to initializes it. Returns a 283 // Wraps GLSurface in scoped_refptr and tries to initializes it. Returns a
275 // scoped_refptr containing the initialized GLSurface or nullptr if 284 // scoped_refptr containing the initialized GLSurface or nullptr if
276 // initialization fails. 285 // initialization fails.
277 GL_EXPORT scoped_refptr<GLSurface> InitializeGLSurface( 286 GL_EXPORT scoped_refptr<GLSurface> InitializeGLSurface(
278 scoped_refptr<GLSurface> surface); 287 scoped_refptr<GLSurface> surface);
279 288
280 } // namespace gl 289 } // namespace gl
281 290
282 #endif // UI_GL_GL_SURFACE_H_ 291 #endif // UI_GL_GL_SURFACE_H_
OLDNEW
« no previous file with comments | « ui/gl/gl_enums_implementation_autogen.h ('k') | ui/gl/gl_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698