| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef WEBKIT_RENDERER_COMPOSITOR_BINDINGS_WEB_LAYER_IMPL_H_ | 5 #ifndef WEBKIT_RENDERER_COMPOSITOR_BINDINGS_WEB_LAYER_IMPL_H_ |
| 6 #define WEBKIT_RENDERER_COMPOSITOR_BINDINGS_WEB_LAYER_IMPL_H_ | 6 #define WEBKIT_RENDERER_COMPOSITOR_BINDINGS_WEB_LAYER_IMPL_H_ |
| 7 | 7 |
| 8 #include <string> |
| 9 |
| 8 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "cc/layers/layer_client.h" |
| 10 #include "third_party/WebKit/public/platform/WebAnimation.h" | 13 #include "third_party/WebKit/public/platform/WebAnimation.h" |
| 14 #include "third_party/WebKit/public/platform/WebCString.h" |
| 11 #include "third_party/WebKit/public/platform/WebColor.h" | 15 #include "third_party/WebKit/public/platform/WebColor.h" |
| 12 #include "third_party/WebKit/public/platform/WebCompositingReasons.h" | 16 #include "third_party/WebKit/public/platform/WebCompositingReasons.h" |
| 13 #include "third_party/WebKit/public/platform/WebFloatPoint.h" | 17 #include "third_party/WebKit/public/platform/WebFloatPoint.h" |
| 14 #include "third_party/WebKit/public/platform/WebLayer.h" | 18 #include "third_party/WebKit/public/platform/WebLayer.h" |
| 15 #include "third_party/WebKit/public/platform/WebPoint.h" | 19 #include "third_party/WebKit/public/platform/WebPoint.h" |
| 16 #include "third_party/WebKit/public/platform/WebRect.h" | 20 #include "third_party/WebKit/public/platform/WebRect.h" |
| 17 #include "third_party/WebKit/public/platform/WebSize.h" | 21 #include "third_party/WebKit/public/platform/WebSize.h" |
| 18 #include "third_party/WebKit/public/platform/WebString.h" | 22 #include "third_party/WebKit/public/platform/WebString.h" |
| 19 #include "third_party/WebKit/public/platform/WebVector.h" | 23 #include "third_party/WebKit/public/platform/WebVector.h" |
| 20 #include "third_party/skia/include/utils/SkMatrix44.h" | 24 #include "third_party/skia/include/utils/SkMatrix44.h" |
| 21 #include "webkit/renderer/compositor_bindings/webkit_compositor_bindings_export.
h" | 25 #include "webkit/renderer/compositor_bindings/webkit_compositor_bindings_export.
h" |
| 22 | 26 |
| 23 namespace cc { class Layer; } | 27 namespace cc { class Layer; } |
| 24 | 28 |
| 25 // TODO(senorblanco): Remove this once WebKit changes have landed. | 29 // TODO(senorblanco): Remove this once WebKit changes have landed. |
| 26 class SkImageFilter; | 30 class SkImageFilter; |
| 27 | 31 |
| 28 namespace WebKit { | 32 namespace WebKit { |
| 29 class WebFilterOperations; | 33 class WebFilterOperations; |
| 30 struct WebFloatRect; | 34 struct WebFloatRect; |
| 31 } | 35 } |
| 32 | 36 |
| 33 namespace webkit { | 37 namespace webkit { |
| 34 | 38 |
| 35 class WebToCCAnimationDelegateAdapter; | 39 class WebToCCAnimationDelegateAdapter; |
| 36 | 40 |
| 37 class WebLayerImpl : public WebKit::WebLayer { | 41 class WebLayerImpl : public WebKit::WebLayer, public cc::LayerClient { |
| 38 public: | 42 public: |
| 39 WEBKIT_COMPOSITOR_BINDINGS_EXPORT WebLayerImpl(); | 43 WEBKIT_COMPOSITOR_BINDINGS_EXPORT WebLayerImpl(); |
| 40 WEBKIT_COMPOSITOR_BINDINGS_EXPORT explicit WebLayerImpl( | 44 WEBKIT_COMPOSITOR_BINDINGS_EXPORT explicit WebLayerImpl( |
| 41 scoped_refptr<cc::Layer>); | 45 scoped_refptr<cc::Layer>); |
| 42 virtual ~WebLayerImpl(); | 46 virtual ~WebLayerImpl(); |
| 43 | 47 |
| 44 WEBKIT_COMPOSITOR_BINDINGS_EXPORT cc::Layer* layer() const; | 48 WEBKIT_COMPOSITOR_BINDINGS_EXPORT cc::Layer* layer() const; |
| 45 | 49 |
| 46 // WebLayer implementation. | 50 // WebLayer implementation. |
| 47 virtual int id() const; | 51 virtual int id() const; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 75 virtual SkMatrix44 transform() const; | 79 virtual SkMatrix44 transform() const; |
| 76 virtual void setDrawsContent(bool draws_content); | 80 virtual void setDrawsContent(bool draws_content); |
| 77 virtual bool drawsContent() const; | 81 virtual bool drawsContent() const; |
| 78 virtual void setPreserves3D(bool preserves_3d); | 82 virtual void setPreserves3D(bool preserves_3d); |
| 79 virtual void setUseParentBackfaceVisibility(bool visible); | 83 virtual void setUseParentBackfaceVisibility(bool visible); |
| 80 virtual void setBackgroundColor(WebKit::WebColor color); | 84 virtual void setBackgroundColor(WebKit::WebColor color); |
| 81 virtual WebKit::WebColor backgroundColor() const; | 85 virtual WebKit::WebColor backgroundColor() const; |
| 82 virtual void setFilter(SkImageFilter* filter); | 86 virtual void setFilter(SkImageFilter* filter); |
| 83 virtual void setFilters(const WebKit::WebFilterOperations& filters); | 87 virtual void setFilters(const WebKit::WebFilterOperations& filters); |
| 84 virtual void setBackgroundFilters(const WebKit::WebFilterOperations& filters); | 88 virtual void setBackgroundFilters(const WebKit::WebFilterOperations& filters); |
| 85 virtual void setDebugName(WebKit::WebString name); | |
| 86 virtual void setCompositingReasons(WebKit::WebCompositingReasons); | 89 virtual void setCompositingReasons(WebKit::WebCompositingReasons); |
| 87 virtual void setAnimationDelegate(WebKit::WebAnimationDelegate* delegate); | 90 virtual void setAnimationDelegate(WebKit::WebAnimationDelegate* delegate); |
| 88 virtual bool addAnimation(WebKit::WebAnimation* animation); | 91 virtual bool addAnimation(WebKit::WebAnimation* animation); |
| 89 virtual void removeAnimation(int animation_id); | 92 virtual void removeAnimation(int animation_id); |
| 90 virtual void removeAnimation(int animation_id, | 93 virtual void removeAnimation(int animation_id, |
| 91 WebKit::WebAnimation::TargetProperty); | 94 WebKit::WebAnimation::TargetProperty); |
| 92 virtual void pauseAnimation(int animation_id, double time_offset); | 95 virtual void pauseAnimation(int animation_id, double time_offset); |
| 93 virtual void suspendAnimations(double monotonic_time); | 96 virtual void suspendAnimations(double monotonic_time); |
| 94 virtual void resumeAnimations(double monotonic_time); | 97 virtual void resumeAnimations(double monotonic_time); |
| 95 virtual bool hasActiveAnimation(); | 98 virtual bool hasActiveAnimation(); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 110 virtual void setTouchEventHandlerRegion( | 113 virtual void setTouchEventHandlerRegion( |
| 111 const WebKit::WebVector<WebKit::WebRect>& region); | 114 const WebKit::WebVector<WebKit::WebRect>& region); |
| 112 virtual WebKit::WebVector<WebKit::WebRect> touchEventHandlerRegion() const; | 115 virtual WebKit::WebVector<WebKit::WebRect> touchEventHandlerRegion() const; |
| 113 virtual void setIsContainerForFixedPositionLayers(bool is_container); | 116 virtual void setIsContainerForFixedPositionLayers(bool is_container); |
| 114 virtual bool isContainerForFixedPositionLayers() const; | 117 virtual bool isContainerForFixedPositionLayers() const; |
| 115 virtual void setPositionConstraint( | 118 virtual void setPositionConstraint( |
| 116 const WebKit::WebLayerPositionConstraint& constraint); | 119 const WebKit::WebLayerPositionConstraint& constraint); |
| 117 virtual WebKit::WebLayerPositionConstraint positionConstraint() const; | 120 virtual WebKit::WebLayerPositionConstraint positionConstraint() const; |
| 118 virtual void setScrollClient(WebKit::WebLayerScrollClient* client); | 121 virtual void setScrollClient(WebKit::WebLayerScrollClient* client); |
| 119 virtual bool isOrphan() const; | 122 virtual bool isOrphan() const; |
| 123 virtual void setWebLayerClient(WebKit::WebLayerClient* client); |
| 124 |
| 125 // LayerClient implementation. |
| 126 virtual std::string DebugName(); |
| 120 | 127 |
| 121 protected: | 128 protected: |
| 122 scoped_refptr<cc::Layer> layer_; | 129 scoped_refptr<cc::Layer> layer_; |
| 130 WebKit::WebLayerClient* web_layer_client_; |
| 123 | 131 |
| 124 private: | 132 private: |
| 125 scoped_ptr<WebToCCAnimationDelegateAdapter> animation_delegate_adapter_; | 133 scoped_ptr<WebToCCAnimationDelegateAdapter> animation_delegate_adapter_; |
| 126 | 134 |
| 127 DISALLOW_COPY_AND_ASSIGN(WebLayerImpl); | 135 DISALLOW_COPY_AND_ASSIGN(WebLayerImpl); |
| 128 }; | 136 }; |
| 129 | 137 |
| 130 } // namespace webkit | 138 } // namespace webkit |
| 131 | 139 |
| 132 #endif // WEBKIT_RENDERER_COMPOSITOR_BINDINGS_WEB_LAYER_IMPL_H_ | 140 #endif // WEBKIT_RENDERER_COMPOSITOR_BINDINGS_WEB_LAYER_IMPL_H_ |
| OLD | NEW |