Chromium Code Reviews| Index: ui/gfx/compositor/compositor.h |
| diff --git a/ui/gfx/compositor/compositor.h b/ui/gfx/compositor/compositor.h |
| index 9475cf62445acfe2de8b85b8450cbaba2fe1cf07..5bc6e2a2be0b44af2296065c391ff61b2314b33d 100644 |
| --- a/ui/gfx/compositor/compositor.h |
| +++ b/ui/gfx/compositor/compositor.h |
| @@ -111,7 +111,7 @@ class COMPOSITOR_EXPORT Texture : public base::RefCounted<Texture> { |
| unsigned int texture_id_; |
| bool flipped_; |
| - gfx::Size size_; |
| + gfx::Size size_; // in pixel |
|
Daniel Erat
2012/05/07 19:44:05
nit: s/pixel/pixels/
|
| DISALLOW_COPY_AND_ASSIGN(Texture); |
| }; |
| @@ -135,8 +135,7 @@ class COMPOSITOR_EXPORT Compositor |
| : NON_EXPORTED_BASE(public WebKit::WebLayerTreeViewClient) { |
| public: |
| Compositor(CompositorDelegate* delegate, |
| - gfx::AcceleratedWidget widget, |
| - const gfx::Size& size); |
| + gfx::AcceleratedWidget widget); |
| virtual ~Compositor(); |
| static void Initialize(bool useThread); |
| @@ -154,6 +153,10 @@ class COMPOSITOR_EXPORT Compositor |
| Layer* root_layer() { return root_layer_; } |
| void SetRootLayer(Layer* root_layer); |
| + // The scale factor of the device that this compositor is |
| + // compositing layers on. |
| + float device_scale_factor() const { return device_scale_factor_; } |
| + |
| // Draws the scene created by the layer tree and any visual effects. If |
| // |force_clear| is true, this will cause the compositor to clear before |
| // compositing. |
| @@ -164,16 +167,16 @@ class COMPOSITOR_EXPORT Compositor |
| // the whole frame needs to be drawn. |
| void ScheduleFullDraw(); |
| - // Reads the region |bounds| of the contents of the last rendered frame |
| - // into the given bitmap. |
| + // Reads the region |bounds_in_pixel| of the contents of the last rendered |
| + // frame into the given bitmap. |
| // Returns false if the pixels could not be read. |
| - bool ReadPixels(SkBitmap* bitmap, const gfx::Rect& bounds); |
| + bool ReadPixels(SkBitmap* bitmap, const gfx::Rect& bounds_in_pixel); |
| - // Notifies the compositor that the size of the widget that it is |
| - // drawing to has changed. |
| - void WidgetSizeChanged(const gfx::Size& size); |
| + // Notifies the compositor that the device scale factor and size of |
| + // the widget that it is drawing to has changed. |
| + void WidgetScaleOrSizeChanged(float scale, const gfx::Size& size_in_pixel); |
| - // Returns the size of the widget that is being drawn to. |
| + // Returns the size of the widget that is being drawn to in pixel coordinates. |
| const gfx::Size& size() const { return size_; } |
| // Returns the widget for this compositor. |
| @@ -201,6 +204,11 @@ class COMPOSITOR_EXPORT Compositor |
| // Signals swap has aborted (e.g. lost context). |
| void OnSwapBuffersAborted(); |
| + // Translates |transform| with translate_offset, then apply the |
| + // device scale factor to the all translate operations in the transform. |
|
Daniel Erat
2012/05/07 19:44:05
nit: s/the all/all the/
oshima
2012/05/08 00:17:24
this is gone now.
|
| + Transform GetTranslateTransform(const Transform& transform, |
| + const gfx::Point& translate_offset) const; |
| + |
| // WebLayerTreeViewClient implementation. |
| virtual void updateAnimations(double frameBeginTime); |
| virtual void layout(); |
| @@ -237,6 +245,12 @@ class COMPOSITOR_EXPORT Compositor |
| // for completion. |
| bool swap_posted_; |
| + float device_scale_factor_; |
| + |
| + // Transforms to scale the translation in |transform_|. |
| + Transform scale_translate_; |
| + Transform inverse_scale_translate_; |
| + |
| friend class base::RefCounted<Compositor>; |
| }; |