| 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 CCLayerImpl_h | 5 #ifndef CCLayerImpl_h |
| 6 #define CCLayerImpl_h | 6 #define CCLayerImpl_h |
| 7 | 7 |
| 8 #include "CCInputHandler.h" | 8 #include "CCInputHandler.h" |
| 9 #include "CCLayerAnimationController.h" | 9 #include "CCLayerAnimationController.h" |
| 10 #include "CCRenderSurface.h" | 10 #include "CCRenderSurface.h" |
| 11 #include "CCResourceProvider.h" | 11 #include "CCResourceProvider.h" |
| 12 #include "CCSharedQuadState.h" | 12 #include "CCSharedQuadState.h" |
| 13 #include "FloatRect.h" | 13 #include "FloatRect.h" |
| 14 #include "IntRect.h" | 14 #include "IntRect.h" |
| 15 #include "Region.h" | 15 #include "Region.h" |
| 16 #include "SkColor.h" | 16 #include "SkColor.h" |
| 17 #include "TextStream.h" | |
| 18 #include <public/WebFilterOperations.h> | 17 #include <public/WebFilterOperations.h> |
| 19 #include <public/WebTransformationMatrix.h> | 18 #include <public/WebTransformationMatrix.h> |
| 19 #include <string> |
| 20 #include <wtf/OwnPtr.h> | 20 #include <wtf/OwnPtr.h> |
| 21 #include <wtf/PassRefPtr.h> | 21 #include <wtf/PassRefPtr.h> |
| 22 #include <wtf/RefCounted.h> | 22 #include <wtf/RefCounted.h> |
| 23 #include <wtf/text/WTFString.h> | |
| 24 | 23 |
| 25 namespace WebCore { | 24 namespace WebCore { |
| 26 | 25 |
| 27 class CCLayerSorter; | 26 class CCLayerSorter; |
| 28 class CCLayerTreeHostImpl; | 27 class CCLayerTreeHostImpl; |
| 29 class CCQuadSink; | 28 class CCQuadSink; |
| 30 class CCRenderer; | 29 class CCRenderer; |
| 31 class CCScrollbarAnimationController; | 30 class CCScrollbarAnimationController; |
| 32 class CCScrollbarLayerImpl; | 31 class CCScrollbarLayerImpl; |
| 33 class LayerChromium; | 32 class LayerChromium; |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 const WebKit::WebTransformationMatrix& sublayerTransform() const { return m_
sublayerTransform; } | 136 const WebKit::WebTransformationMatrix& sublayerTransform() const { return m_
sublayerTransform; } |
| 138 | 137 |
| 139 // Debug layer border - visual effect only, do not change geometry/clipping/
etc. | 138 // Debug layer border - visual effect only, do not change geometry/clipping/
etc. |
| 140 void setDebugBorderColor(SkColor); | 139 void setDebugBorderColor(SkColor); |
| 141 SkColor debugBorderColor() const { return m_debugBorderColor; } | 140 SkColor debugBorderColor() const { return m_debugBorderColor; } |
| 142 void setDebugBorderWidth(float); | 141 void setDebugBorderWidth(float); |
| 143 float debugBorderWidth() const { return m_debugBorderWidth; } | 142 float debugBorderWidth() const { return m_debugBorderWidth; } |
| 144 bool hasDebugBorders() const; | 143 bool hasDebugBorders() const; |
| 145 | 144 |
| 146 // Debug layer name. | 145 // Debug layer name. |
| 147 void setDebugName(const String& debugName) { m_debugName = debugName; } | 146 void setDebugName(const std::string& debugName) { m_debugName = debugName; } |
| 148 String debugName() const { return m_debugName; } | 147 std::string debugName() const { return m_debugName; } |
| 149 | 148 |
| 150 CCRenderSurface* renderSurface() const { return m_renderSurface.get(); } | 149 CCRenderSurface* renderSurface() const { return m_renderSurface.get(); } |
| 151 void createRenderSurface(); | 150 void createRenderSurface(); |
| 152 void clearRenderSurface() { m_renderSurface.clear(); } | 151 void clearRenderSurface() { m_renderSurface.clear(); } |
| 153 | 152 |
| 154 float drawOpacity() const { return m_drawOpacity; } | 153 float drawOpacity() const { return m_drawOpacity; } |
| 155 void setDrawOpacity(float opacity) { m_drawOpacity = opacity; } | 154 void setDrawOpacity(float opacity) { m_drawOpacity = opacity; } |
| 156 | 155 |
| 157 bool drawOpacityIsAnimating() const { return m_drawOpacityIsAnimating; } | 156 bool drawOpacityIsAnimating() const { return m_drawOpacityIsAnimating; } |
| 158 void setDrawOpacityIsAnimating(bool drawOpacityIsAnimating) { m_drawOpacityI
sAnimating = drawOpacityIsAnimating; } | 157 void setDrawOpacityIsAnimating(bool drawOpacityIsAnimating) { m_drawOpacityI
sAnimating = drawOpacityIsAnimating; } |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 bool drawTransformIsAnimating() const { return m_drawTransformIsAnimating; } | 216 bool drawTransformIsAnimating() const { return m_drawTransformIsAnimating; } |
| 218 void setDrawTransformIsAnimating(bool animating) { m_drawTransformIsAnimatin
g = animating; } | 217 void setDrawTransformIsAnimating(bool animating) { m_drawTransformIsAnimatin
g = animating; } |
| 219 bool screenSpaceTransformIsAnimating() const { return m_screenSpaceTransform
IsAnimating; } | 218 bool screenSpaceTransformIsAnimating() const { return m_screenSpaceTransform
IsAnimating; } |
| 220 void setScreenSpaceTransformIsAnimating(bool animating) { m_screenSpaceTrans
formIsAnimating = animating; } | 219 void setScreenSpaceTransformIsAnimating(bool animating) { m_screenSpaceTrans
formIsAnimating = animating; } |
| 221 | 220 |
| 222 const IntRect& drawableContentRect() const { return m_drawableContentRect; } | 221 const IntRect& drawableContentRect() const { return m_drawableContentRect; } |
| 223 void setDrawableContentRect(const IntRect& rect) { m_drawableContentRect = r
ect; } | 222 void setDrawableContentRect(const IntRect& rect) { m_drawableContentRect = r
ect; } |
| 224 const FloatRect& updateRect() const { return m_updateRect; } | 223 const FloatRect& updateRect() const { return m_updateRect; } |
| 225 void setUpdateRect(const FloatRect& updateRect) { m_updateRect = updateRect;
} | 224 void setUpdateRect(const FloatRect& updateRect) { m_updateRect = updateRect;
} |
| 226 | 225 |
| 227 String layerTreeAsText() const; | 226 std::string layerTreeAsText() const; |
| 228 | 227 |
| 229 void setStackingOrderChanged(bool); | 228 void setStackingOrderChanged(bool); |
| 230 | 229 |
| 231 bool layerPropertyChanged() const { return m_layerPropertyChanged || layerIs
AlwaysDamaged(); } | 230 bool layerPropertyChanged() const { return m_layerPropertyChanged || layerIs
AlwaysDamaged(); } |
| 232 bool layerSurfacePropertyChanged() const; | 231 bool layerSurfacePropertyChanged() const; |
| 233 | 232 |
| 234 void resetAllChangeTrackingForSubtree(); | 233 void resetAllChangeTrackingForSubtree(); |
| 235 | 234 |
| 236 virtual bool layerIsAlwaysDamaged() const { return false; } | 235 virtual bool layerIsAlwaysDamaged() const { return false; } |
| 237 | 236 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 250 void setHorizontalScrollbarLayer(CCScrollbarLayerImpl*); | 249 void setHorizontalScrollbarLayer(CCScrollbarLayerImpl*); |
| 251 | 250 |
| 252 CCScrollbarLayerImpl* verticalScrollbarLayer() const; | 251 CCScrollbarLayerImpl* verticalScrollbarLayer() const; |
| 253 void setVerticalScrollbarLayer(CCScrollbarLayerImpl*); | 252 void setVerticalScrollbarLayer(CCScrollbarLayerImpl*); |
| 254 | 253 |
| 255 protected: | 254 protected: |
| 256 explicit CCLayerImpl(int); | 255 explicit CCLayerImpl(int); |
| 257 | 256 |
| 258 void appendDebugBorderQuad(CCQuadSink&, const CCSharedQuadState*, CCAppendQu
adsData&) const; | 257 void appendDebugBorderQuad(CCQuadSink&, const CCSharedQuadState*, CCAppendQu
adsData&) const; |
| 259 | 258 |
| 260 virtual void dumpLayerProperties(TextStream&, int indent) const; | 259 virtual void dumpLayerProperties(std::string*, int indent) const; |
| 261 static void writeIndent(TextStream&, int indent); | 260 static std::string indentString(int indent); |
| 262 | 261 |
| 263 private: | 262 private: |
| 264 void setParent(CCLayerImpl* parent) { m_parent = parent; } | 263 void setParent(CCLayerImpl* parent) { m_parent = parent; } |
| 265 friend class TreeSynchronizer; | 264 friend class TreeSynchronizer; |
| 266 void clearChildList(); // Warning: This does not preserve tree structure inv
ariants and so is only exposed to the tree synchronizer. | 265 void clearChildList(); // Warning: This does not preserve tree structure inv
ariants and so is only exposed to the tree synchronizer. |
| 267 | 266 |
| 268 void noteLayerPropertyChangedForSubtree(); | 267 void noteLayerPropertyChangedForSubtree(); |
| 269 | 268 |
| 270 // Note carefully this does not affect the current layer. | 269 // Note carefully this does not affect the current layer. |
| 271 void noteLayerPropertyChangedForDescendants(); | 270 void noteLayerPropertyChangedForDescendants(); |
| 272 | 271 |
| 273 virtual const char* layerTypeAsString() const { return "LayerChromium"; } | 272 virtual const char* layerTypeAsString() const { return "LayerChromium"; } |
| 274 | 273 |
| 275 void dumpLayer(TextStream&, int indent) const; | 274 void dumpLayer(std::string*, int indent) const; |
| 276 | 275 |
| 277 // Properties internal to CCLayerImpl | 276 // Properties internal to CCLayerImpl |
| 278 CCLayerImpl* m_parent; | 277 CCLayerImpl* m_parent; |
| 279 Vector<OwnPtr<CCLayerImpl> > m_children; | 278 Vector<OwnPtr<CCLayerImpl> > m_children; |
| 280 // m_maskLayer can be temporarily stolen during tree sync, we need this ID t
o confirm newly assigned layer is still the previous one | 279 // m_maskLayer can be temporarily stolen during tree sync, we need this ID t
o confirm newly assigned layer is still the previous one |
| 281 int m_maskLayerId; | 280 int m_maskLayerId; |
| 282 OwnPtr<CCLayerImpl> m_maskLayer; | 281 OwnPtr<CCLayerImpl> m_maskLayer; |
| 283 int m_replicaLayerId; // ditto | 282 int m_replicaLayerId; // ditto |
| 284 OwnPtr<CCLayerImpl> m_replicaLayer; | 283 OwnPtr<CCLayerImpl> m_replicaLayer; |
| 285 int m_layerId; | 284 int m_layerId; |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 // to sort layers from back to front. | 343 // to sort layers from back to front. |
| 345 float m_drawDepth; | 344 float m_drawDepth; |
| 346 float m_drawOpacity; | 345 float m_drawOpacity; |
| 347 bool m_drawOpacityIsAnimating; | 346 bool m_drawOpacityIsAnimating; |
| 348 | 347 |
| 349 // Debug borders. | 348 // Debug borders. |
| 350 SkColor m_debugBorderColor; | 349 SkColor m_debugBorderColor; |
| 351 float m_debugBorderWidth; | 350 float m_debugBorderWidth; |
| 352 | 351 |
| 353 // Debug layer name. | 352 // Debug layer name. |
| 354 String m_debugName; | 353 std::string m_debugName; |
| 355 | 354 |
| 356 WebKit::WebFilterOperations m_filters; | 355 WebKit::WebFilterOperations m_filters; |
| 357 WebKit::WebFilterOperations m_backgroundFilters; | 356 WebKit::WebFilterOperations m_backgroundFilters; |
| 358 | 357 |
| 359 WebKit::WebTransformationMatrix m_drawTransform; | 358 WebKit::WebTransformationMatrix m_drawTransform; |
| 360 WebKit::WebTransformationMatrix m_screenSpaceTransform; | 359 WebKit::WebTransformationMatrix m_screenSpaceTransform; |
| 361 bool m_drawTransformIsAnimating; | 360 bool m_drawTransformIsAnimating; |
| 362 bool m_screenSpaceTransformIsAnimating; | 361 bool m_screenSpaceTransformIsAnimating; |
| 363 | 362 |
| 364 #ifndef NDEBUG | 363 #ifndef NDEBUG |
| (...skipping 18 matching lines...) Expand all Loading... |
| 383 | 382 |
| 384 // Manages scrollbars for this layer | 383 // Manages scrollbars for this layer |
| 385 OwnPtr<CCScrollbarAnimationController> m_scrollbarAnimationController; | 384 OwnPtr<CCScrollbarAnimationController> m_scrollbarAnimationController; |
| 386 }; | 385 }; |
| 387 | 386 |
| 388 void sortLayers(Vector<CCLayerImpl*>::iterator first, Vector<CCLayerImpl*>::iter
ator end, CCLayerSorter*); | 387 void sortLayers(Vector<CCLayerImpl*>::iterator first, Vector<CCLayerImpl*>::iter
ator end, CCLayerSorter*); |
| 389 | 388 |
| 390 } | 389 } |
| 391 | 390 |
| 392 #endif // CCLayerImpl_h | 391 #endif // CCLayerImpl_h |
| OLD | NEW |