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 CC_LAYER_IMPL_H_ | 5 #ifndef CC_LAYER_IMPL_H_ |
6 #define CC_LAYER_IMPL_H_ | 6 #define CC_LAYER_IMPL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 | 138 |
139 void setUseParentBackfaceVisibility(bool useParentBackfaceVisibility) { m_us
eParentBackfaceVisibility = useParentBackfaceVisibility; } | 139 void setUseParentBackfaceVisibility(bool useParentBackfaceVisibility) { m_us
eParentBackfaceVisibility = useParentBackfaceVisibility; } |
140 bool useParentBackfaceVisibility() const { return m_useParentBackfaceVisibil
ity; } | 140 bool useParentBackfaceVisibility() const { return m_useParentBackfaceVisibil
ity; } |
141 | 141 |
142 void setUseLCDText(bool useLCDText) { m_useLCDText = useLCDText; } | 142 void setUseLCDText(bool useLCDText) { m_useLCDText = useLCDText; } |
143 bool useLCDText() const { return m_useLCDText; } | 143 bool useLCDText() const { return m_useLCDText; } |
144 | 144 |
145 void setSublayerTransform(const WebKit::WebTransformationMatrix&); | 145 void setSublayerTransform(const WebKit::WebTransformationMatrix&); |
146 const WebKit::WebTransformationMatrix& sublayerTransform() const { return m_
sublayerTransform; } | 146 const WebKit::WebTransformationMatrix& sublayerTransform() const { return m_
sublayerTransform; } |
147 | 147 |
148 // Debug layer border - visual effect only, do not change geometry/clipping/
etc. | |
149 void setDebugBorderColor(SkColor); | |
150 SkColor debugBorderColor() const { return m_debugBorderColor; } | |
151 void setDebugBorderWidth(float); | |
152 float debugBorderWidth() const { return m_debugBorderWidth; } | |
153 bool hasDebugBorders() const; | |
154 | |
155 // Debug layer name. | 148 // Debug layer name. |
156 void setDebugName(const std::string& debugName) { m_debugName = debugName; } | 149 void setDebugName(const std::string& debugName) { m_debugName = debugName; } |
157 std::string debugName() const { return m_debugName; } | 150 std::string debugName() const { return m_debugName; } |
158 | 151 |
| 152 bool showDebugBorders() const; |
| 153 |
159 RenderSurfaceImpl* renderSurface() const { return m_renderSurface.get(); } | 154 RenderSurfaceImpl* renderSurface() const { return m_renderSurface.get(); } |
160 void createRenderSurface(); | 155 void createRenderSurface(); |
161 void clearRenderSurface() { m_renderSurface.reset(); } | 156 void clearRenderSurface() { m_renderSurface.reset(); } |
162 | 157 |
163 float drawOpacity() const { return m_drawOpacity; } | 158 float drawOpacity() const { return m_drawOpacity; } |
164 void setDrawOpacity(float opacity) { m_drawOpacity = opacity; } | 159 void setDrawOpacity(float opacity) { m_drawOpacity = opacity; } |
165 | 160 |
166 bool drawOpacityIsAnimating() const { return m_drawOpacityIsAnimating; } | 161 bool drawOpacityIsAnimating() const { return m_drawOpacityIsAnimating; } |
167 void setDrawOpacityIsAnimating(bool drawOpacityIsAnimating) { m_drawOpacityI
sAnimating = drawOpacityIsAnimating; } | 162 void setDrawOpacityIsAnimating(bool drawOpacityIsAnimating) { m_drawOpacityI
sAnimating = drawOpacityIsAnimating; } |
168 | 163 |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 void setHorizontalScrollbarLayer(ScrollbarLayerImpl*); | 268 void setHorizontalScrollbarLayer(ScrollbarLayerImpl*); |
274 | 269 |
275 ScrollbarLayerImpl* verticalScrollbarLayer() const; | 270 ScrollbarLayerImpl* verticalScrollbarLayer() const; |
276 void setVerticalScrollbarLayer(ScrollbarLayerImpl*); | 271 void setVerticalScrollbarLayer(ScrollbarLayerImpl*); |
277 | 272 |
278 gfx::Rect layerRectToContentRect(const gfx::RectF& layerRect) const; | 273 gfx::Rect layerRectToContentRect(const gfx::RectF& layerRect) const; |
279 | 274 |
280 protected: | 275 protected: |
281 explicit LayerImpl(int); | 276 explicit LayerImpl(int); |
282 | 277 |
| 278 // Get the color and size of the layer's debug border. |
| 279 virtual void getDebugBorderProperties(SkColor*, float* width) const; |
| 280 |
283 void appendDebugBorderQuad(QuadSink&, const SharedQuadState*, AppendQuadsDat
a&) const; | 281 void appendDebugBorderQuad(QuadSink&, const SharedQuadState*, AppendQuadsDat
a&) const; |
284 | 282 |
285 virtual void dumpLayerProperties(std::string*, int indent) const; | 283 virtual void dumpLayerProperties(std::string*, int indent) const; |
286 static std::string indentString(int indent); | 284 static std::string indentString(int indent); |
287 | 285 |
288 private: | 286 private: |
289 void setParent(LayerImpl* parent) { m_parent = parent; } | 287 void setParent(LayerImpl* parent) { m_parent = parent; } |
290 friend class TreeSynchronizer; | 288 friend class TreeSynchronizer; |
291 void clearChildList(); // Warning: This does not preserve tree structure inv
ariants and so is only exposed to the tree synchronizer. | 289 void clearChildList(); // Warning: This does not preserve tree structure inv
ariants and so is only exposed to the tree synchronizer. |
292 | 290 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 // either the same layer (m_renderTarget == this) or an ancestor of this | 365 // either the same layer (m_renderTarget == this) or an ancestor of this |
368 // layer. | 366 // layer. |
369 LayerImpl* m_renderTarget; | 367 LayerImpl* m_renderTarget; |
370 | 368 |
371 // The global depth value of the center of the layer. This value is used | 369 // The global depth value of the center of the layer. This value is used |
372 // to sort layers from back to front. | 370 // to sort layers from back to front. |
373 float m_drawDepth; | 371 float m_drawDepth; |
374 float m_drawOpacity; | 372 float m_drawOpacity; |
375 bool m_drawOpacityIsAnimating; | 373 bool m_drawOpacityIsAnimating; |
376 | 374 |
377 // Debug borders. | |
378 SkColor m_debugBorderColor; | |
379 float m_debugBorderWidth; | |
380 | |
381 // Debug layer name. | 375 // Debug layer name. |
382 std::string m_debugName; | 376 std::string m_debugName; |
383 | 377 |
384 WebKit::WebFilterOperations m_filters; | 378 WebKit::WebFilterOperations m_filters; |
385 WebKit::WebFilterOperations m_backgroundFilters; | 379 WebKit::WebFilterOperations m_backgroundFilters; |
386 SkImageFilter* m_filter; | 380 SkImageFilter* m_filter; |
387 | 381 |
388 WebKit::WebTransformationMatrix m_drawTransform; | 382 WebKit::WebTransformationMatrix m_drawTransform; |
389 WebKit::WebTransformationMatrix m_screenSpaceTransform; | 383 WebKit::WebTransformationMatrix m_screenSpaceTransform; |
390 bool m_drawTransformIsAnimating; | 384 bool m_drawTransformIsAnimating; |
(...skipping 23 matching lines...) Expand all Loading... |
414 scoped_ptr<ScrollbarAnimationController> m_scrollbarAnimationController; | 408 scoped_ptr<ScrollbarAnimationController> m_scrollbarAnimationController; |
415 | 409 |
416 DISALLOW_COPY_AND_ASSIGN(LayerImpl); | 410 DISALLOW_COPY_AND_ASSIGN(LayerImpl); |
417 }; | 411 }; |
418 | 412 |
419 void sortLayers(std::vector<LayerImpl*>::iterator first, std::vector<LayerImpl*>
::iterator end, LayerSorter*); | 413 void sortLayers(std::vector<LayerImpl*>::iterator first, std::vector<LayerImpl*>
::iterator end, LayerSorter*); |
420 | 414 |
421 } | 415 } |
422 | 416 |
423 #endif // CC_LAYER_IMPL_H_ | 417 #endif // CC_LAYER_IMPL_H_ |
OLD | NEW |