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 | 5 |
6 #ifndef LayerChromium_h | 6 #ifndef LayerChromium_h |
7 #define LayerChromium_h | 7 #define LayerChromium_h |
8 | 8 |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "CCLayerAnimationController.h" | 10 #include "CCLayerAnimationController.h" |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 // That is, it converts from logical, non-page-scaled, to target pixels (and
if the target is the | 215 // That is, it converts from logical, non-page-scaled, to target pixels (and
if the target is the |
216 // root render surface, then this converts to physical pixels). | 216 // root render surface, then this converts to physical pixels). |
217 const WebKit::WebTransformationMatrix& drawTransform() const { return m_draw
Transform; } | 217 const WebKit::WebTransformationMatrix& drawTransform() const { return m_draw
Transform; } |
218 void setDrawTransform(const WebKit::WebTransformationMatrix& matrix) { m_dra
wTransform = matrix; } | 218 void setDrawTransform(const WebKit::WebTransformationMatrix& matrix) { m_dra
wTransform = matrix; } |
219 // This moves from content space, with origin the top left to screen space w
ith origin in the top left. | 219 // This moves from content space, with origin the top left to screen space w
ith origin in the top left. |
220 // It converts logical, non-page-scaled pixels to physical pixels. | 220 // It converts logical, non-page-scaled pixels to physical pixels. |
221 const WebKit::WebTransformationMatrix& screenSpaceTransform() const { return
m_screenSpaceTransform; } | 221 const WebKit::WebTransformationMatrix& screenSpaceTransform() const { return
m_screenSpaceTransform; } |
222 void setScreenSpaceTransform(const WebKit::WebTransformationMatrix& matrix)
{ m_screenSpaceTransform = matrix; } | 222 void setScreenSpaceTransform(const WebKit::WebTransformationMatrix& matrix)
{ m_screenSpaceTransform = matrix; } |
223 const IntRect& drawableContentRect() const { return m_drawableContentRect; } | 223 const IntRect& drawableContentRect() const { return m_drawableContentRect; } |
224 void setDrawableContentRect(const IntRect& rect) { m_drawableContentRect = r
ect; } | 224 void setDrawableContentRect(const IntRect& rect) { m_drawableContentRect = r
ect; } |
| 225 |
225 // The contentsScale converts from logical, non-page-scaled pixels to target
pixels. | 226 // The contentsScale converts from logical, non-page-scaled pixels to target
pixels. |
226 // The contentsScale is 1 for the root layer as it is already in physical pi
xels. | 227 // The contentsScale is 1 for the root layer as it is already in physical pi
xels. |
227 float contentsScale() const { return m_contentsScale; } | 228 float contentsScale() const { return m_contentsScale; } |
228 void setContentsScale(float); | 229 void setContentsScale(float); |
| 230 // The scale from the initial CSS transform of the layer, including its ance
stors, but |
| 231 // not including the deviceScaleFactor or pageScaleFactor. |
| 232 float initialCssScale() const { return m_initialCssScale; } |
| 233 void setInitialCssScale(float scale) { m_initialCssScale = scale; } |
229 | 234 |
230 // When true, the layer's contents are not scaled by the current page scale
factor. | 235 // When true, the layer's contents are not scaled by the current page scale
factor. |
231 // setBoundsContainPageScale recursively sets the value on all child layers. | 236 // setBoundsContainPageScale recursively sets the value on all child layers. |
232 void setBoundsContainPageScale(bool); | 237 void setBoundsContainPageScale(bool); |
233 bool boundsContainPageScale() const { return m_boundsContainPageScale; } | 238 bool boundsContainPageScale() const { return m_boundsContainPageScale; } |
234 | 239 |
235 // Returns true if any of the layer's descendants has content to draw. | 240 // Returns true if any of the layer's descendants has content to draw. |
236 bool descendantDrawsContent(); | 241 bool descendantDrawsContent(); |
237 | 242 |
238 CCLayerTreeHost* layerTreeHost() const { return m_layerTreeHost; } | 243 CCLayerTreeHost* layerTreeHost() const { return m_layerTreeHost; } |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 LayerChromium* m_renderTarget; | 370 LayerChromium* m_renderTarget; |
366 | 371 |
367 WebKit::WebTransformationMatrix m_drawTransform; | 372 WebKit::WebTransformationMatrix m_drawTransform; |
368 WebKit::WebTransformationMatrix m_screenSpaceTransform; | 373 WebKit::WebTransformationMatrix m_screenSpaceTransform; |
369 bool m_drawTransformIsAnimating; | 374 bool m_drawTransformIsAnimating; |
370 bool m_screenSpaceTransformIsAnimating; | 375 bool m_screenSpaceTransformIsAnimating; |
371 | 376 |
372 // Uses target surface space. | 377 // Uses target surface space. |
373 IntRect m_drawableContentRect; | 378 IntRect m_drawableContentRect; |
374 float m_contentsScale; | 379 float m_contentsScale; |
| 380 float m_initialCssScale; |
375 bool m_boundsContainPageScale; | 381 bool m_boundsContainPageScale; |
376 | 382 |
377 WebKit::WebTransformationMatrix m_implTransform; | 383 WebKit::WebTransformationMatrix m_implTransform; |
378 | 384 |
379 WebKit::WebAnimationDelegate* m_layerAnimationDelegate; | 385 WebKit::WebAnimationDelegate* m_layerAnimationDelegate; |
380 WebKit::WebLayerScrollClient* m_layerScrollClient; | 386 WebKit::WebLayerScrollClient* m_layerScrollClient; |
381 }; | 387 }; |
382 | 388 |
383 void sortLayers(std::vector<scoped_refptr<LayerChromium> >::iterator, std::vecto
r<scoped_refptr<LayerChromium> >::iterator, void*); | 389 void sortLayers(std::vector<scoped_refptr<LayerChromium> >::iterator, std::vecto
r<scoped_refptr<LayerChromium> >::iterator, void*); |
384 | 390 |
385 } | 391 } |
386 #endif | 392 #endif |
OLD | NEW |