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

Side by Side Diff: cc/layer_tree_host_common.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: rebase Created 8 years, 2 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
« no previous file with comments | « cc/layer_tree_host.cc ('k') | cc/layer_tree_host_common.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 CCLayerTreeHostCommon_h 5 #ifndef CCLayerTreeHostCommon_h
6 #define CCLayerTreeHostCommon_h 6 #define CCLayerTreeHostCommon_h
7 7
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "cc/scoped_ptr_vector.h" 9 #include "cc/scoped_ptr_vector.h"
10 #include "IntRect.h" 10 #include "IntRect.h"
11 #include "IntSize.h" 11 #include "IntSize.h"
12 #include <public/WebTransformationMatrix.h> 12 #include <public/WebTransformationMatrix.h>
13 #include <wtf/Vector.h> 13 #include <wtf/Vector.h>
14 14
15 namespace cc { 15 namespace cc {
16 16
17 class CCLayerImpl; 17 class CCLayerImpl;
18 class CCLayerSorter; 18 class CCLayerSorter;
19 class LayerChromium; 19 class LayerChromium;
20 20
21 class CCLayerTreeHostCommon { 21 class CCLayerTreeHostCommon {
22 public: 22 public:
23 static IntRect calculateVisibleRect(const IntRect& targetSurfaceRect, const IntRect& layerBoundRect, const WebKit::WebTransformationMatrix&); 23 static IntRect calculateVisibleRect(const IntRect& targetSurfaceRect, const IntRect& layerBoundRect, const WebKit::WebTransformationMatrix&);
24 24
25 static void calculateDrawTransforms(LayerChromium* rootLayer, const IntSize& deviceViewportSize, float deviceScaleFactor, int maxTextureSize, std::vector<sc oped_refptr<LayerChromium> >& renderSurfaceLayerList); 25 static void calculateDrawTransforms(LayerChromium* rootLayer, const IntSize& deviceViewportSize, float deviceScaleFactor, float pageScaleFactor, int maxText ureSize, std::vector<scoped_refptr<LayerChromium> >& renderSurfaceLayerList);
26 static void calculateDrawTransforms(CCLayerImpl* rootLayer, const IntSize& d eviceViewportSize, float deviceScaleFactor, CCLayerSorter*, int maxTextureSize, std::vector<CCLayerImpl*>& renderSurfaceLayerList); 26 static void calculateDrawTransforms(CCLayerImpl* rootLayer, const IntSize& d eviceViewportSize, float deviceScaleFactor, float pageScaleFactor, CCLayerSorter *, int maxTextureSize, std::vector<CCLayerImpl*>& renderSurfaceLayerList);
27 27
28 // Performs hit testing for a given renderSurfaceLayerList. 28 // Performs hit testing for a given renderSurfaceLayerList.
29 static CCLayerImpl* findLayerThatIsHitByPoint(const IntPoint& viewportPoint, std::vector<CCLayerImpl*>& renderSurfaceLayerList); 29 static CCLayerImpl* findLayerThatIsHitByPoint(const IntPoint& viewportPoint, std::vector<CCLayerImpl*>& renderSurfaceLayerList);
30 30
31 template<typename LayerType> static bool renderSurfaceContributesToTarget(La yerType*, int targetSurfaceLayerID); 31 template<typename LayerType> static bool renderSurfaceContributesToTarget(La yerType*, int targetSurfaceLayerID);
32 32
33 // Returns a layer with the given id if one exists in the subtree starting 33 // Returns a layer with the given id if one exists in the subtree starting
34 // from the given root layer (including mask and replica layers). 34 // from the given root layer (including mask and replica layers).
35 template<typename LayerType> static LayerType* findLayerInSubtree(LayerType* rootLayer, int layerId); 35 template<typename LayerType> static LayerType* findLayerInSubtree(LayerType* rootLayer, int layerId);
36 36
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 for (size_t i = 0; i < rootLayer->children().size(); ++i) { 87 for (size_t i = 0; i < rootLayer->children().size(); ++i) {
88 if (LayerType* found = findLayerInSubtree(getChildAsRawPtr(rootLayer->ch ildren(), i), layerId)) 88 if (LayerType* found = findLayerInSubtree(getChildAsRawPtr(rootLayer->ch ildren(), i), layerId))
89 return found; 89 return found;
90 } 90 }
91 return 0; 91 return 0;
92 } 92 }
93 93
94 } // namespace cc 94 } // namespace cc
95 95
96 #endif 96 #endif
OLDNEW
« no previous file with comments | « cc/layer_tree_host.cc ('k') | cc/layer_tree_host_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698