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

Unified Diff: ui/gfx/compositor/compositor.h

Issue 7552039: Vend common GL context (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge with ToT Created 9 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 side-by-side diff with in-line comments
Download patch
Index: ui/gfx/compositor/compositor.h
diff --git a/ui/gfx/compositor/compositor.h b/ui/gfx/compositor/compositor.h
index df575ddad11972f4fe6a7c6b4d8e3c8811c48404..467ec4f0d292ad56dccceec1e637ddca925b44fb 100644
--- a/ui/gfx/compositor/compositor.h
+++ b/ui/gfx/compositor/compositor.h
@@ -10,12 +10,12 @@
#include "ui/gfx/compositor/compositor_export.h"
#include "ui/gfx/transform.h"
#include "ui/gfx/native_widget_types.h"
+#include "ui/gfx/size.h"
class SkCanvas;
namespace gfx {
class Point;
class Rect;
-class Size;
}
namespace ui {
@@ -50,11 +50,13 @@ class COMPOSITOR_EXPORT Texture : public base::RefCounted<Texture> {
const gfx::Size& overall_size) = 0;
// Draws the texture.
- virtual void Draw(const ui::TextureDrawParams& params) = 0;
+ virtual void Draw(const ui::TextureDrawParams& params,
+ const gfx::Size& surface_size) = 0;
sky 2011/08/24 21:17:08 Move this into TextureDrawParams. I think the name
jonathan.backer 2011/08/25 18:57:18 Done.
// Draws the portion of the texture contained within clip_bounds
virtual void Draw(const ui::TextureDrawParams& params,
- const gfx::Rect& clip_bounds_in_texture) = 0;
+ const gfx::Rect& clip_bounds_in_texture,
+ const gfx::Size& surface_size) = 0;
protected:
virtual ~Texture() {}
@@ -93,10 +95,18 @@ class COMPOSITOR_EXPORT Compositor : public base::RefCounted<Compositor> {
// drawing to has changed.
virtual void OnWidgetSizeChanged(const gfx::Size& size) = 0;
sky 2011/08/24 21:17:08 Rename this to WidgetSizeChanged, make it concrete
jonathan.backer 2011/08/25 18:57:18 Done.
+ // Returns the size of the widget that is being drawn to.
+ const gfx::Size& size() { return size_; }
+
protected:
+ explicit Compositor(const gfx::Size& size) : size_(size) {}
virtual ~Compositor() {}
+ void SetSize(const gfx::Size& size) { size_ = size; }
sky 2011/08/24 21:17:08 Is this needed?
jonathan.backer 2011/08/25 18:57:18 Done.
+
private:
+ gfx::Size size_;
+
friend class base::RefCounted<Compositor>;
};

Powered by Google App Engine
This is Rietveld 408576698