Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(521)

Side by Side Diff: cc/LayerChromium.h

Issue 10915313: cc: Apply the layer's initial CSS scale to the contentsScale to render text at the right resolution. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: initialCssScale Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 void setBoundsContainPageScale(bool); 240 void setBoundsContainPageScale(bool);
236 bool boundsContainPageScale() const { return m_boundsContainPageScale; } 241 bool boundsContainPageScale() const { return m_boundsContainPageScale; }
237 242
238 // Returns true if any of the layer's descendants has content to draw. 243 // Returns true if any of the layer's descendants has content to draw.
239 bool descendantDrawsContent(); 244 bool descendantDrawsContent();
240 245
241 CCLayerTreeHost* layerTreeHost() const { return m_layerTreeHost; } 246 CCLayerTreeHost* layerTreeHost() const { return m_layerTreeHost; }
242 247
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 LayerChromium* m_renderTarget; 368 LayerChromium* m_renderTarget;
364 369
365 WebKit::WebTransformationMatrix m_drawTransform; 370 WebKit::WebTransformationMatrix m_drawTransform;
366 WebKit::WebTransformationMatrix m_screenSpaceTransform; 371 WebKit::WebTransformationMatrix m_screenSpaceTransform;
367 bool m_drawTransformIsAnimating; 372 bool m_drawTransformIsAnimating;
368 bool m_screenSpaceTransformIsAnimating; 373 bool m_screenSpaceTransformIsAnimating;
369 374
370 // Uses target surface space. 375 // Uses target surface space.
371 IntRect m_drawableContentRect; 376 IntRect m_drawableContentRect;
372 float m_contentsScale; 377 float m_contentsScale;
378 float m_initialCssScale;
373 bool m_boundsContainPageScale; 379 bool m_boundsContainPageScale;
374 380
375 WebKit::WebAnimationDelegate* m_layerAnimationDelegate; 381 WebKit::WebAnimationDelegate* m_layerAnimationDelegate;
376 WebKit::WebLayerScrollClient* m_layerScrollClient; 382 WebKit::WebLayerScrollClient* m_layerScrollClient;
377 }; 383 };
378 384
379 void sortLayers(Vector<RefPtr<LayerChromium> >::iterator, Vector<RefPtr<LayerChr omium> >::iterator, void*); 385 void sortLayers(Vector<RefPtr<LayerChromium> >::iterator, Vector<RefPtr<LayerChr omium> >::iterator, void*);
380 386
381 } 387 }
382 #endif // USE(ACCELERATED_COMPOSITING) 388 #endif // USE(ACCELERATED_COMPOSITING)
383 389
384 #endif 390 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698