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

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: Address reviewer comments. 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..42bb770cd756f0958b3a5db73b2f4e88310a5026 100644
--- a/ui/gfx/compositor/compositor.h
+++ b/ui/gfx/compositor/compositor.h
@@ -10,18 +10,18 @@
#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 {
struct TextureDrawParams {
- TextureDrawParams() : transform(), blend(false) {}
+ TextureDrawParams() : transform(), blend(false), compositor_size() {}
// The transform to be applied to the texture.
ui::Transform transform;
@@ -30,6 +30,9 @@ struct TextureDrawParams {
// Otherwise, the drawn pixels clobber the old pixels.
bool blend;
+ // The size of the surface that the texture is drawn to.
+ gfx::Size compositor_size;
+
// Copy and assignment are allowed.
};
@@ -91,12 +94,23 @@ class COMPOSITOR_EXPORT Compositor : public base::RefCounted<Compositor> {
// Notifies the compositor that the size of the widget that it is
// drawing to has changed.
- virtual void OnWidgetSizeChanged(const gfx::Size& size) = 0;
+ void WidgetSizeChanged(const gfx::Size& size) {
+ size_ = size;
+ OnWidgetSizeChanged();
+ }
+
+ // 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() {}
+ virtual void OnWidgetSizeChanged() = 0;
+
private:
+ gfx::Size size_;
+
friend class base::RefCounted<Compositor>;
};
« no previous file with comments | « chrome/browser/renderer_host/render_widget_host_view_views_touch.cc ('k') | ui/gfx/compositor/compositor_gl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698