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

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

Issue 2006923006: Move all CARendererLayerTree parameters to separate struct. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 5 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
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_image.h"
22 #include "ui/gl/gl_implementation.h" 22 #include "ui/gl/gl_implementation.h"
23 23
24 namespace gfx { 24 namespace gfx {
25 class Transform; 25 class Transform;
26 class VSyncProvider; 26 class VSyncProvider;
27 } 27 }
28 28
29 namespace ui {
30 struct CARendererLayerParams;
31 }
32
29 namespace gl { 33 namespace gl {
30 34
31 class GLContext; 35 class GLContext;
32 36
33 // Encapsulates a surface that can be rendered to with GL, hiding platform 37 // Encapsulates a surface that can be rendered to with GL, hiding platform
34 // specific management. 38 // specific management.
35 class GL_EXPORT GLSurface : public base::RefCounted<GLSurface> { 39 class GL_EXPORT GLSurface : public base::RefCounted<GLSurface> {
36 public: 40 public:
37 GLSurface(); 41 GLSurface();
38 42
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 // |crop_rect| specifies the region within the buffer to be placed inside 170 // |crop_rect| specifies the region within the buffer to be placed inside
167 // |bounds_rect|. 171 // |bounds_rect|.
168 virtual bool ScheduleOverlayPlane(int z_order, 172 virtual bool ScheduleOverlayPlane(int z_order,
169 gfx::OverlayTransform transform, 173 gfx::OverlayTransform transform,
170 GLImage* image, 174 GLImage* image,
171 const gfx::Rect& bounds_rect, 175 const gfx::Rect& bounds_rect,
172 const gfx::RectF& crop_rect); 176 const gfx::RectF& crop_rect);
173 177
174 // Schedule a CALayer to be shown at swap time. 178 // Schedule a CALayer to be shown at swap time.
175 // All arguments correspond to their CALayer properties. 179 // All arguments correspond to their CALayer properties.
176 virtual bool ScheduleCALayer(GLImage* contents_image, 180 virtual bool ScheduleCALayer(const ui::CARendererLayerParams& params);
177 const gfx::RectF& contents_rect, 181
178 float opacity,
179 unsigned background_color,
180 unsigned edge_aa_mask,
181 const gfx::RectF& rect,
182 bool is_clipped,
183 const gfx::RectF& clip_rect,
184 const gfx::Transform& transform,
185 int sorting_content_id,
186 unsigned filter);
187 struct GL_EXPORT CALayerInUseQuery { 182 struct GL_EXPORT CALayerInUseQuery {
188 CALayerInUseQuery(); 183 CALayerInUseQuery();
189 explicit CALayerInUseQuery(const CALayerInUseQuery&); 184 explicit CALayerInUseQuery(const CALayerInUseQuery&);
190 ~CALayerInUseQuery(); 185 ~CALayerInUseQuery();
191 unsigned texture = 0; 186 unsigned texture = 0;
192 scoped_refptr<GLImage> image; 187 scoped_refptr<GLImage> image;
193 }; 188 };
194 virtual void ScheduleCALayerInUseQuery( 189 virtual void ScheduleCALayerInUseQuery(
195 std::vector<CALayerInUseQuery> queries); 190 std::vector<CALayerInUseQuery> queries);
196 191
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 277
283 // Wraps GLSurface in scoped_refptr and tries to initializes it. Returns a 278 // Wraps GLSurface in scoped_refptr and tries to initializes it. Returns a
284 // scoped_refptr containing the initialized GLSurface or nullptr if 279 // scoped_refptr containing the initialized GLSurface or nullptr if
285 // initialization fails. 280 // initialization fails.
286 GL_EXPORT scoped_refptr<GLSurface> InitializeGLSurface( 281 GL_EXPORT scoped_refptr<GLSurface> InitializeGLSurface(
287 scoped_refptr<GLSurface> surface); 282 scoped_refptr<GLSurface> surface);
288 283
289 } // namespace gl 284 } // namespace gl
290 285
291 #endif // UI_GL_GL_SURFACE_H_ 286 #endif // UI_GL_GL_SURFACE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698