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