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

Unified Diff: ui/gl/gl_surface.h

Issue 2735853002: Offset scissor and viewport when using SetDrawRectangle on surface. (Closed)
Patch Set: remove flag Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/ipc/service/direct_composition_surface_win.cc ('k') | ui/gl/gl_surface.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_surface.h
diff --git a/ui/gl/gl_surface.h b/ui/gl/gl_surface.h
index 1dee05919103c97ca75de083e0efaf30a260c405..cb934964332999810167056778543249cf50699d 100644
--- a/ui/gl/gl_surface.h
+++ b/ui/gl/gl_surface.h
@@ -14,6 +14,7 @@
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/rect_f.h"
#include "ui/gfx/geometry/size.h"
+#include "ui/gfx/geometry/vector2d.h"
#include "ui/gfx/native_widget_types.h"
#include "ui/gfx/overlay_transform.h"
#include "ui/gfx/swap_result.h"
@@ -210,6 +211,10 @@ class GL_EXPORT GLSurface : public base::RefCounted<GLSurface> {
// Set the rectangle that will be drawn into on the surface.
virtual bool SetDrawRectangle(const gfx::Rect& rect);
+ // This is the amount by which the scissor and viewport rectangles should be
+ // offset.
+ virtual gfx::Vector2d GetDrawOffset() const;
+
static GLSurface* GetCurrent();
// Called when the swap interval for the associated context changes.
@@ -282,6 +287,7 @@ class GL_EXPORT GLSurfaceAdapter : public GLSurface {
bool BuffersFlipped() const override;
bool SupportsSetDrawRectangle() const override;
bool SetDrawRectangle(const gfx::Rect& rect) override;
+ gfx::Vector2d GetDrawOffset() const override;
void OnSetSwapInterval(int interval) override;
GLSurface* surface() const { return surface_.get(); }
« no previous file with comments | « gpu/ipc/service/direct_composition_surface_win.cc ('k') | ui/gl/gl_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698