| Index: ui/gfx/compositor/layer.h
|
| diff --git a/ui/gfx/compositor/layer.h b/ui/gfx/compositor/layer.h
|
| index 06b3d02b1f45fa591c8d09573f82824c037b33dd..91dc05f0650210ca5341d27c73beb68f882c4a55 100644
|
| --- a/ui/gfx/compositor/layer.h
|
| +++ b/ui/gfx/compositor/layer.h
|
| @@ -12,6 +12,9 @@
|
| #include "base/memory/ref_counted.h"
|
| #include "base/memory/scoped_ptr.h"
|
| #include "base/message_loop.h"
|
| +#include "third_party/WebKit/Source/WebKit/chromium/public/WebContentLayer.h"
|
| +#include "third_party/WebKit/Source/WebKit/chromium/public/WebContentLayerClient.h"
|
| +#include "third_party/WebKit/Source/WebKit/chromium/public/WebLayerClient.h"
|
| #include "ui/gfx/rect.h"
|
| #include "ui/gfx/transform.h"
|
| #include "ui/gfx/compositor/compositor.h"
|
| @@ -35,7 +38,10 @@ class Texture;
|
| // NOTE: unlike Views, each Layer does *not* own its children views. If you
|
| // delete a Layer and it has children, the parent of each child layer is set to
|
| // NULL, but the children are not deleted.
|
| -class COMPOSITOR_EXPORT Layer : public LayerAnimatorDelegate {
|
| +class COMPOSITOR_EXPORT Layer :
|
| + public LayerAnimatorDelegate,
|
| + NON_EXPORTED_BASE(public WebKit::WebLayerClient),
|
| + NON_EXPORTED_BASE(public WebKit::WebContentLayerClient) {
|
| public:
|
| enum LayerType {
|
| LAYER_HAS_NO_TEXTURE = 0,
|
| @@ -118,7 +124,7 @@ class COMPOSITOR_EXPORT Layer : public LayerAnimatorDelegate {
|
|
|
| // Returns true if this layer can have a texture (has_texture_ is true)
|
| // and is not completely obscured by a child.
|
| - bool ShouldDraw();
|
| + bool ShouldDraw() const;
|
|
|
| // Converts a point from the coordinates of |source| to the coordinates of
|
| // |target|. Necessarily, |source| and |target| must inhabit the same Layer
|
| @@ -166,6 +172,16 @@ class COMPOSITOR_EXPORT Layer : public LayerAnimatorDelegate {
|
| // (e.g. the GPU process on TOUCH_UI).
|
| bool layer_updated_externally() const { return layer_updated_externally_; }
|
|
|
| + // WebLayerClient
|
| + virtual void notifyNeedsComposite();
|
| +
|
| + // WebContentLayerClient
|
| + virtual void paintContents(WebKit::WebCanvas*, const WebKit::WebRect& clip);
|
| +
|
| +#if defined(USE_WEBKIT_COMPOSITOR)
|
| + WebKit::WebContentLayer web_layer() { return web_layer_; }
|
| +#endif
|
| +
|
| private:
|
| // TODO(vollick): Eventually, if a non-leaf node has an opacity of less than
|
| // 1.0, we'll render to a separate texture, and then apply the alpha.
|
| @@ -240,6 +256,12 @@ class COMPOSITOR_EXPORT Layer : public LayerAnimatorDelegate {
|
| virtual void SetTransformFromAnimator(const Transform& transform) OVERRIDE;
|
| virtual void SetOpacityFromAnimator(float opacity) OVERRIDE;
|
|
|
| +#if defined(USE_WEBKIT_COMPOSITOR)
|
| + void CreateWebLayer();
|
| + void RecomputeTransform();
|
| + void RecomputeDrawsContent();
|
| +#endif
|
| +
|
| const LayerType type_;
|
|
|
| Compositor* compositor_;
|
| @@ -272,6 +294,10 @@ class COMPOSITOR_EXPORT Layer : public LayerAnimatorDelegate {
|
|
|
| scoped_ptr<LayerAnimator> animator_;
|
|
|
| +#if defined(USE_WEBKIT_COMPOSITOR)
|
| + WebKit::WebContentLayer web_layer_;
|
| +#endif
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(Layer);
|
| };
|
|
|
|
|