OLD | NEW |
---|---|
1 // Copyright 2010 The Chromium Authors. All rights reserved. | 1 // Copyright 2010 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_H_ | 5 #ifndef CC_LAYER_H_ |
6 #define CC_LAYER_H_ | 6 #define CC_LAYER_H_ |
7 | 7 |
8 #include <public/WebFilterOperations.h> | 8 #include <public/WebFilterOperations.h> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
133 DrawProperties<Layer, RenderSurface>& drawProperties() { return m_drawProper ties; } | 133 DrawProperties<Layer, RenderSurface>& drawProperties() { return m_drawProper ties; } |
134 const DrawProperties<Layer, RenderSurface>& drawProperties() const { return m_drawProperties; } | 134 const DrawProperties<Layer, RenderSurface>& drawProperties() const { return m_drawProperties; } |
135 | 135 |
136 // The following are shortcut accessors to get various information from m_dr awProperties | 136 // The following are shortcut accessors to get various information from m_dr awProperties |
137 const gfx::Transform& drawTransform() const { return m_drawProperties.target _space_transform; } | 137 const gfx::Transform& drawTransform() const { return m_drawProperties.target _space_transform; } |
138 const gfx::Transform& screenSpaceTransform() const { return m_drawProperties .screen_space_transform; } | 138 const gfx::Transform& screenSpaceTransform() const { return m_drawProperties .screen_space_transform; } |
139 float drawOpacity() const { return m_drawProperties.opacity; } | 139 float drawOpacity() const { return m_drawProperties.opacity; } |
140 bool drawOpacityIsAnimating() const { return m_drawProperties.opacity_is_ani mating; } | 140 bool drawOpacityIsAnimating() const { return m_drawProperties.opacity_is_ani mating; } |
141 bool drawTransformIsAnimating() const { return m_drawProperties.target_space _transform_is_animating; } | 141 bool drawTransformIsAnimating() const { return m_drawProperties.target_space _transform_is_animating; } |
142 bool screenSpaceTransformIsAnimating() const { return m_drawProperties.scree n_space_transform_is_animating; } | 142 bool screenSpaceTransformIsAnimating() const { return m_drawProperties.scree n_space_transform_is_animating; } |
143 bool screenSpaceOpacityIsAnimating() const { return m_drawProperties.screen_ space_opacity_is_animating; } | |
143 bool isClipped() const { return m_drawProperties.is_clipped; } | 144 bool isClipped() const { return m_drawProperties.is_clipped; } |
144 const gfx::Rect& clipRect() const { return m_drawProperties.clip_rect; } | 145 const gfx::Rect& clipRect() const { return m_drawProperties.clip_rect; } |
145 const gfx::Rect& drawableContentRect() const { return m_drawProperties.drawa ble_content_rect; } | 146 const gfx::Rect& drawableContentRect() const { return m_drawProperties.drawa ble_content_rect; } |
146 const gfx::Rect& visibleContentRect() const { return m_drawProperties.visibl e_content_rect; } | 147 const gfx::Rect& visibleContentRect() const { return m_drawProperties.visibl e_content_rect; } |
147 Layer* renderTarget() { DCHECK(!m_drawProperties.render_target || m_drawProp erties.render_target->renderSurface()); return m_drawProperties.render_target; } | 148 Layer* renderTarget() { DCHECK(!m_drawProperties.render_target || m_drawProp erties.render_target->renderSurface()); return m_drawProperties.render_target; } |
148 const Layer* renderTarget() const { DCHECK(!m_drawProperties.render_target | | m_drawProperties.render_target->renderSurface()); return m_drawProperties.rend er_target; } | 149 const Layer* renderTarget() const { DCHECK(!m_drawProperties.render_target | | m_drawProperties.render_target->renderSurface()); return m_drawProperties.rend er_target; } |
149 RenderSurface* renderSurface() const { return m_drawProperties.render_surfac e.get(); } | 150 RenderSurface* renderSurface() const { return m_drawProperties.render_surfac e.get(); } |
150 | 151 |
151 void setScrollOffset(gfx::Vector2d); | 152 void setScrollOffset(gfx::Vector2d); |
152 gfx::Vector2d scrollOffset() const { return m_scrollOffset; } | 153 gfx::Vector2d scrollOffset() const { return m_scrollOffset; } |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
186 | 187 |
187 void setDoubleSided(bool); | 188 void setDoubleSided(bool); |
188 bool doubleSided() const { return m_doubleSided; } | 189 bool doubleSided() const { return m_doubleSided; } |
189 | 190 |
190 void setPreserves3D(bool preserve3D) { m_preserves3D = preserve3D; } | 191 void setPreserves3D(bool preserve3D) { m_preserves3D = preserve3D; } |
191 bool preserves3D() const { return m_preserves3D; } | 192 bool preserves3D() const { return m_preserves3D; } |
192 | 193 |
193 void setUseParentBackfaceVisibility(bool useParentBackfaceVisibility) { m_us eParentBackfaceVisibility = useParentBackfaceVisibility; } | 194 void setUseParentBackfaceVisibility(bool useParentBackfaceVisibility) { m_us eParentBackfaceVisibility = useParentBackfaceVisibility; } |
194 bool useParentBackfaceVisibility() const { return m_useParentBackfaceVisibil ity; } | 195 bool useParentBackfaceVisibility() const { return m_useParentBackfaceVisibil ity; } |
195 | 196 |
196 void setUseLCDText(bool); | 197 void setCanUseLCDText(bool); |
197 bool useLCDText() const { return m_useLCDText; } | 198 bool canUseLCDText() const { return m_canUseLCDText; } |
198 | 199 |
199 virtual void setLayerTreeHost(LayerTreeHost*); | 200 virtual void setLayerTreeHost(LayerTreeHost*); |
200 | 201 |
201 bool hasContributingDelegatedRenderPasses() const { return false; } | 202 bool hasContributingDelegatedRenderPasses() const { return false; } |
202 | 203 |
203 void setIsDrawable(bool); | 204 void setIsDrawable(bool); |
204 | 205 |
205 void setReplicaLayer(Layer*); | 206 void setReplicaLayer(Layer*); |
206 Layer* replicaLayer() { return m_replicaLayer.get(); } | 207 Layer* replicaLayer() { return m_replicaLayer.get(); } |
207 const Layer* replicaLayer() const { return m_replicaLayer.get(); } | 208 const Layer* replicaLayer() const { return m_replicaLayer.get(); } |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
291 protected: | 292 protected: |
292 friend class LayerImpl; | 293 friend class LayerImpl; |
293 friend class TreeSynchronizer; | 294 friend class TreeSynchronizer; |
294 virtual ~Layer(); | 295 virtual ~Layer(); |
295 | 296 |
296 Layer(); | 297 Layer(); |
297 | 298 |
298 void setNeedsCommit(); | 299 void setNeedsCommit(); |
299 void setNeedsFullTreeSync(); | 300 void setNeedsFullTreeSync(); |
300 | 301 |
302 // Called when LCD text setting is about to potentially change. | |
303 // If this function returns true, the setting is allowed to change. | |
304 // If it returns false, the setting is not changed. | |
305 virtual bool canUseLCDTextWillChange(); | |
enne (OOO)
2012/12/11 02:47:15
Can you do this without adding more virtuals to La
alokp
2012/12/11 05:07:21
I do not understand your solution but the reason I
alokp
2012/12/12 17:42:24
Done.
| |
306 virtual void canUseLCDTextDidChange() { } | |
307 | |
301 // This flag is set when layer need repainting/updating. | 308 // This flag is set when layer need repainting/updating. |
302 bool m_needsDisplay; | 309 bool m_needsDisplay; |
303 | 310 |
304 // Tracks whether this layer may have changed stacking order with its siblin gs. | 311 // Tracks whether this layer may have changed stacking order with its siblin gs. |
305 bool m_stackingOrderChanged; | 312 bool m_stackingOrderChanged; |
306 | 313 |
307 // The update rect is the region of the compositor resource that was actuall y updated by the compositor. | 314 // The update rect is the region of the compositor resource that was actuall y updated by the compositor. |
308 // For layers that may do updating outside the compositor's control (i.e. pl ugin layers), this information | 315 // For layers that may do updating outside the compositor's control (i.e. pl ugin layers), this information |
309 // is not available and the update rect will remain empty. | 316 // is not available and the update rect will remain empty. |
310 // Note this rect is in layer space (not content space). | 317 // Note this rect is in layer space (not content space). |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
361 skia::RefPtr<SkImageFilter> m_filter; | 368 skia::RefPtr<SkImageFilter> m_filter; |
362 WebKit::WebFilterOperations m_filters; | 369 WebKit::WebFilterOperations m_filters; |
363 WebKit::WebFilterOperations m_backgroundFilters; | 370 WebKit::WebFilterOperations m_backgroundFilters; |
364 float m_anchorPointZ; | 371 float m_anchorPointZ; |
365 bool m_isContainerForFixedPositionLayers; | 372 bool m_isContainerForFixedPositionLayers; |
366 bool m_fixedToContainerLayer; | 373 bool m_fixedToContainerLayer; |
367 bool m_isDrawable; | 374 bool m_isDrawable; |
368 bool m_masksToBounds; | 375 bool m_masksToBounds; |
369 bool m_contentsOpaque; | 376 bool m_contentsOpaque; |
370 bool m_doubleSided; | 377 bool m_doubleSided; |
371 bool m_useLCDText; | 378 bool m_canUseLCDText; |
enne (OOO)
2012/12/11 02:47:15
Can you move this to DrawProperties? I think it be
alokp
2012/12/11 05:07:21
I considered doing that but I could think of a goo
alokp
2012/12/12 17:42:24
Done.
| |
372 bool m_preserves3D; | 379 bool m_preserves3D; |
373 bool m_useParentBackfaceVisibility; | 380 bool m_useParentBackfaceVisibility; |
374 bool m_drawCheckerboardForMissingTiles; | 381 bool m_drawCheckerboardForMissingTiles; |
375 bool m_forceRenderSurface; | 382 bool m_forceRenderSurface; |
376 | 383 |
377 gfx::Transform m_transform; | 384 gfx::Transform m_transform; |
378 gfx::Transform m_sublayerTransform; | 385 gfx::Transform m_sublayerTransform; |
379 | 386 |
380 // Replica layer used for reflections. | 387 // Replica layer used for reflections. |
381 scoped_refptr<Layer> m_replicaLayer; | 388 scoped_refptr<Layer> m_replicaLayer; |
382 | 389 |
383 // Transient properties. | 390 // Transient properties. |
384 float m_rasterScale; | 391 float m_rasterScale; |
385 bool m_automaticallyComputeRasterScale; | 392 bool m_automaticallyComputeRasterScale; |
386 bool m_boundsContainPageScale; | 393 bool m_boundsContainPageScale; |
387 | 394 |
388 gfx::Transform m_implTransform; | 395 gfx::Transform m_implTransform; |
389 | 396 |
390 WebKit::WebAnimationDelegate* m_layerAnimationDelegate; | 397 WebKit::WebAnimationDelegate* m_layerAnimationDelegate; |
391 WebKit::WebLayerScrollClient* m_layerScrollClient; | 398 WebKit::WebLayerScrollClient* m_layerScrollClient; |
392 | 399 |
393 DrawProperties<Layer, RenderSurface> m_drawProperties; | 400 DrawProperties<Layer, RenderSurface> m_drawProperties; |
394 }; | 401 }; |
395 | 402 |
396 void sortLayers(std::vector<scoped_refptr<Layer> >::iterator, std::vector<scoped _refptr<Layer> >::iterator, void*); | 403 void sortLayers(std::vector<scoped_refptr<Layer> >::iterator, std::vector<scoped _refptr<Layer> >::iterator, void*); |
397 | 404 |
398 } // namespace cc | 405 } // namespace cc |
399 | 406 |
400 #endif // CC_LAYER_H_ | 407 #endif // CC_LAYER_H_ |
OLD | NEW |