| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CC_BLINK_WEB_LAYER_IMPL_H_ | 5 #ifndef CC_BLINK_WEB_LAYER_IMPL_H_ |
| 6 #define CC_BLINK_WEB_LAYER_IMPL_H_ | 6 #define CC_BLINK_WEB_LAYER_IMPL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 struct WebFloatRect; | 32 struct WebFloatRect; |
| 33 } | 33 } |
| 34 | 34 |
| 35 namespace base { | 35 namespace base { |
| 36 namespace trace_event { | 36 namespace trace_event { |
| 37 class ConvertableToTraceFormat; | 37 class ConvertableToTraceFormat; |
| 38 } | 38 } |
| 39 } | 39 } |
| 40 | 40 |
| 41 namespace cc { | 41 namespace cc { |
| 42 class Animation; | |
| 43 class FilterOperations; | 42 class FilterOperations; |
| 44 class Layer; | 43 class Layer; |
| 45 class LayerSettings; | 44 class LayerSettings; |
| 46 } | 45 } |
| 47 | 46 |
| 48 namespace cc_blink { | 47 namespace cc_blink { |
| 49 | 48 |
| 50 class WebToCCAnimationDelegateAdapter; | |
| 51 | |
| 52 class WebLayerImpl : public blink::WebLayer { | 49 class WebLayerImpl : public blink::WebLayer { |
| 53 public: | 50 public: |
| 54 CC_BLINK_EXPORT WebLayerImpl(); | 51 CC_BLINK_EXPORT WebLayerImpl(); |
| 55 CC_BLINK_EXPORT explicit WebLayerImpl(scoped_refptr<cc::Layer>); | 52 CC_BLINK_EXPORT explicit WebLayerImpl(scoped_refptr<cc::Layer>); |
| 56 ~WebLayerImpl() override; | 53 ~WebLayerImpl() override; |
| 57 | 54 |
| 58 CC_BLINK_EXPORT static void SetLayerSettings( | |
| 59 const cc::LayerSettings& settings); | |
| 60 CC_BLINK_EXPORT static const cc::LayerSettings& LayerSettings(); | |
| 61 | |
| 62 CC_BLINK_EXPORT cc::Layer* layer() const; | 55 CC_BLINK_EXPORT cc::Layer* layer() const; |
| 63 | 56 |
| 64 // If set to true, content opaqueness cannot be changed using setOpaque. | 57 // If set to true, content opaqueness cannot be changed using setOpaque. |
| 65 // However, it can still be modified using SetContentsOpaque on the | 58 // However, it can still be modified using SetContentsOpaque on the |
| 66 // cc::Layer. | 59 // cc::Layer. |
| 67 CC_BLINK_EXPORT void SetContentsOpaqueIsFixed(bool fixed); | 60 CC_BLINK_EXPORT void SetContentsOpaqueIsFixed(bool fixed); |
| 68 | 61 |
| 69 // WebLayer implementation. | 62 // WebLayer implementation. |
| 70 int id() const override; | 63 int id() const override; |
| 71 void invalidateRect(const blink::WebRect&) override; | 64 void invalidateRect(const blink::WebRect&) override; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 99 void setDrawsContent(bool draws_content) override; | 92 void setDrawsContent(bool draws_content) override; |
| 100 bool drawsContent() const override; | 93 bool drawsContent() const override; |
| 101 void setDoubleSided(bool double_sided) override; | 94 void setDoubleSided(bool double_sided) override; |
| 102 void setShouldFlattenTransform(bool flatten) override; | 95 void setShouldFlattenTransform(bool flatten) override; |
| 103 void setRenderingContext(int context) override; | 96 void setRenderingContext(int context) override; |
| 104 void setUseParentBackfaceVisibility(bool visible) override; | 97 void setUseParentBackfaceVisibility(bool visible) override; |
| 105 void setBackgroundColor(blink::WebColor color) override; | 98 void setBackgroundColor(blink::WebColor color) override; |
| 106 blink::WebColor backgroundColor() const override; | 99 blink::WebColor backgroundColor() const override; |
| 107 void setFilters(const cc::FilterOperations& filters) override; | 100 void setFilters(const cc::FilterOperations& filters) override; |
| 108 void setBackgroundFilters(const cc::FilterOperations& filters) override; | 101 void setBackgroundFilters(const cc::FilterOperations& filters) override; |
| 109 void setAnimationDelegate( | 102 bool hasActiveAnimationForTesting() override; |
| 110 blink::WebCompositorAnimationDelegate* delegate) override; | |
| 111 bool addAnimation(cc::Animation* animation) override; | |
| 112 void removeAnimation(int animation_id) override; | |
| 113 void pauseAnimation(int animation_id, double time_offset) override; | |
| 114 void abortAnimation(int animation_id) override; | |
| 115 bool hasActiveAnimation() override; | |
| 116 void setForceRenderSurface(bool force) override; | 103 void setForceRenderSurface(bool force) override; |
| 117 void setScrollPositionDouble(blink::WebDoublePoint position) override; | 104 void setScrollPositionDouble(blink::WebDoublePoint position) override; |
| 118 blink::WebDoublePoint scrollPositionDouble() const override; | 105 blink::WebDoublePoint scrollPositionDouble() const override; |
| 119 void setScrollCompensationAdjustment(blink::WebDoublePoint position) override; | 106 void setScrollCompensationAdjustment(blink::WebDoublePoint position) override; |
| 120 void setScrollClipLayer(blink::WebLayer* clip_layer) override; | 107 void setScrollClipLayer(blink::WebLayer* clip_layer) override; |
| 121 bool scrollable() const override; | 108 bool scrollable() const override; |
| 122 void setUserScrollable(bool horizontal, bool vertical) override; | 109 void setUserScrollable(bool horizontal, bool vertical) override; |
| 123 bool userScrollableHorizontal() const override; | 110 bool userScrollableHorizontal() const override; |
| 124 bool userScrollableVertical() const override; | 111 bool userScrollableVertical() const override; |
| 125 void addMainThreadScrollingReasons( | 112 void addMainThreadScrollingReasons( |
| (...skipping 28 matching lines...) Expand all Loading... |
| 154 | 141 |
| 155 void setScrollParent(blink::WebLayer* parent) override; | 142 void setScrollParent(blink::WebLayer* parent) override; |
| 156 void setClipParent(blink::WebLayer* parent) override; | 143 void setClipParent(blink::WebLayer* parent) override; |
| 157 | 144 |
| 158 protected: | 145 protected: |
| 159 scoped_refptr<cc::Layer> layer_; | 146 scoped_refptr<cc::Layer> layer_; |
| 160 | 147 |
| 161 bool contents_opaque_is_fixed_; | 148 bool contents_opaque_is_fixed_; |
| 162 | 149 |
| 163 private: | 150 private: |
| 164 scoped_ptr<WebToCCAnimationDelegateAdapter> animation_delegate_adapter_; | |
| 165 | |
| 166 DISALLOW_COPY_AND_ASSIGN(WebLayerImpl); | 151 DISALLOW_COPY_AND_ASSIGN(WebLayerImpl); |
| 167 }; | 152 }; |
| 168 | 153 |
| 169 } // namespace cc_blink | 154 } // namespace cc_blink |
| 170 | 155 |
| 171 #endif // CC_BLINK_WEB_LAYER_IMPL_H_ | 156 #endif // CC_BLINK_WEB_LAYER_IMPL_H_ |
| OLD | NEW |