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

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

Issue 2933453002: Always use DirectCompositionSurfaceWin when using DirectComposition (Closed)
Patch Set: post-review fixes Created 3 years, 4 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 | « gpu/ipc/service/image_transport_surface_win.cc ('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"
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 virtual bool IsSurfaceless() const; 206 virtual bool IsSurfaceless() const;
207 207
208 virtual bool FlipsVertically() const; 208 virtual bool FlipsVertically() const;
209 209
210 // Returns true if SwapBuffers or PostSubBuffers causes a flip, such that 210 // Returns true if SwapBuffers or PostSubBuffers causes a flip, such that
211 // the next buffer may be 2 frames old. 211 // the next buffer may be 2 frames old.
212 virtual bool BuffersFlipped() const; 212 virtual bool BuffersFlipped() const;
213 213
214 virtual bool SupportsDCLayers() const; 214 virtual bool SupportsDCLayers() const;
215 215
216 virtual bool UseOverlaysForVideo() const;
217
216 // Set the rectangle that will be drawn into on the surface. 218 // Set the rectangle that will be drawn into on the surface.
217 virtual bool SetDrawRectangle(const gfx::Rect& rect); 219 virtual bool SetDrawRectangle(const gfx::Rect& rect);
218 220
219 // This is the amount by which the scissor and viewport rectangles should be 221 // This is the amount by which the scissor and viewport rectangles should be
220 // offset. 222 // offset.
221 virtual gfx::Vector2d GetDrawOffset() const; 223 virtual gfx::Vector2d GetDrawOffset() const;
222 224
223 // This waits until rendering work is complete enough that an OS snapshot 225 // This waits until rendering work is complete enough that an OS snapshot
224 // will capture the last swapped contents. A GL context must be current when 226 // will capture the last swapped contents. A GL context must be current when
225 // calling this. 227 // calling this.
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 gfx::OverlayTransform transform, 293 gfx::OverlayTransform transform,
292 GLImage* image, 294 GLImage* image,
293 const gfx::Rect& bounds_rect, 295 const gfx::Rect& bounds_rect,
294 const gfx::RectF& crop_rect) override; 296 const gfx::RectF& crop_rect) override;
295 bool ScheduleDCLayer(const ui::DCRendererLayerParams& params) override; 297 bool ScheduleDCLayer(const ui::DCRendererLayerParams& params) override;
296 bool SetEnableDCLayers(bool enable) override; 298 bool SetEnableDCLayers(bool enable) override;
297 bool IsSurfaceless() const override; 299 bool IsSurfaceless() const override;
298 bool FlipsVertically() const override; 300 bool FlipsVertically() const override;
299 bool BuffersFlipped() const override; 301 bool BuffersFlipped() const override;
300 bool SupportsDCLayers() const override; 302 bool SupportsDCLayers() const override;
303 bool UseOverlaysForVideo() const override;
301 bool SetDrawRectangle(const gfx::Rect& rect) override; 304 bool SetDrawRectangle(const gfx::Rect& rect) override;
302 gfx::Vector2d GetDrawOffset() const override; 305 gfx::Vector2d GetDrawOffset() const override;
303 void WaitForSnapshotRendering() override; 306 void WaitForSnapshotRendering() override;
304 void SetRelyOnImplicitSync() override; 307 void SetRelyOnImplicitSync() override;
305 308
306 GLSurface* surface() const { return surface_.get(); } 309 GLSurface* surface() const { return surface_.get(); }
307 310
308 protected: 311 protected:
309 ~GLSurfaceAdapter() override; 312 ~GLSurfaceAdapter() override;
310 313
311 private: 314 private:
312 scoped_refptr<GLSurface> surface_; 315 scoped_refptr<GLSurface> surface_;
313 316
314 DISALLOW_COPY_AND_ASSIGN(GLSurfaceAdapter); 317 DISALLOW_COPY_AND_ASSIGN(GLSurfaceAdapter);
315 }; 318 };
316 319
317 // Wraps GLSurface in scoped_refptr and tries to initializes it. Returns a 320 // Wraps GLSurface in scoped_refptr and tries to initializes it. Returns a
318 // scoped_refptr containing the initialized GLSurface or nullptr if 321 // scoped_refptr containing the initialized GLSurface or nullptr if
319 // initialization fails. 322 // initialization fails.
320 GL_EXPORT scoped_refptr<GLSurface> InitializeGLSurface( 323 GL_EXPORT scoped_refptr<GLSurface> InitializeGLSurface(
321 scoped_refptr<GLSurface> surface); 324 scoped_refptr<GLSurface> surface);
322 325
323 GL_EXPORT scoped_refptr<GLSurface> InitializeGLSurfaceWithFormat( 326 GL_EXPORT scoped_refptr<GLSurface> InitializeGLSurfaceWithFormat(
324 scoped_refptr<GLSurface> surface, GLSurfaceFormat format); 327 scoped_refptr<GLSurface> surface, GLSurfaceFormat format);
325 328
326 } // namespace gl 329 } // namespace gl
327 330
328 #endif // UI_GL_GL_SURFACE_H_ 331 #endif // UI_GL_GL_SURFACE_H_
OLDNEW
« no previous file with comments | « gpu/ipc/service/image_transport_surface_win.cc ('k') | ui/gl/gl_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698