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

Side by Side Diff: cc/layer_tree_host_common.h

Issue 11360093: Mark layers that can use LCD text based on layer transform and opacity. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed unit tests Created 8 years, 1 month 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 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 CC_LAYER_TREE_HOST_COMMON_H_ 5 #ifndef CC_LAYER_TREE_HOST_COMMON_H_
6 #define CC_LAYER_TREE_HOST_COMMON_H_ 6 #define CC_LAYER_TREE_HOST_COMMON_H_
7 7
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "cc/cc_export.h" 9 #include "cc/cc_export.h"
10 #include "cc/scoped_ptr_vector.h" 10 #include "cc/scoped_ptr_vector.h"
11 #include "ui/gfx/rect.h" 11 #include "ui/gfx/rect.h"
12 #include "ui/gfx/vector2d.h" 12 #include "ui/gfx/vector2d.h"
13 #include <public/WebTransformationMatrix.h> 13 #include <public/WebTransformationMatrix.h>
14 14
15 namespace cc { 15 namespace cc {
16 16
17 class LayerImpl; 17 class LayerImpl;
18 class LayerSorter; 18 class LayerSorter;
19 class Layer; 19 class Layer;
20 20
21 class CC_EXPORT LayerTreeHostCommon { 21 class CC_EXPORT LayerTreeHostCommon {
22 public: 22 public:
23 // Returns the default LCD text setting.
danakj 2012/11/07 18:15:00 Can we make this a LayerTreeSetting instead? Other
alokp 2012/11/08 22:34:07 Done.
24 static bool canUseLCDText();
25
23 static gfx::Rect calculateVisibleRect(const gfx::Rect& targetSurfaceRect, co nst gfx::Rect& layerBoundRect, const WebKit::WebTransformationMatrix&); 26 static gfx::Rect calculateVisibleRect(const gfx::Rect& targetSurfaceRect, co nst gfx::Rect& layerBoundRect, const WebKit::WebTransformationMatrix&);
24 27
25 static void calculateDrawTransforms(Layer* rootLayer, const gfx::Size& devic eViewportSize, float deviceScaleFactor, float pageScaleFactor, int maxTextureSiz e, std::vector<scoped_refptr<Layer> >& renderSurfaceLayerList); 28 static void calculateDrawTransforms(Layer* rootLayer, const gfx::Size& devic eViewportSize, float deviceScaleFactor, float pageScaleFactor, int maxTextureSiz e, std::vector<scoped_refptr<Layer> >& renderSurfaceLayerList);
26 static void calculateDrawTransforms(LayerImpl* rootLayer, const gfx::Size& d eviceViewportSize, float deviceScaleFactor, float pageScaleFactor, LayerSorter*, int maxTextureSize, std::vector<LayerImpl*>& renderSurfaceLayerList); 29 static void calculateDrawTransforms(LayerImpl* rootLayer, const gfx::Size& d eviceViewportSize, float deviceScaleFactor, float pageScaleFactor, LayerSorter*, int maxTextureSize, std::vector<LayerImpl*>& renderSurfaceLayerList);
27 30
28 // Performs hit testing for a given renderSurfaceLayerList. 31 // Performs hit testing for a given renderSurfaceLayerList.
29 static LayerImpl* findLayerThatIsHitByPoint(const gfx::PointF& screenSpacePo int, std::vector<LayerImpl*>& renderSurfaceLayerList); 32 static LayerImpl* findLayerThatIsHitByPoint(const gfx::PointF& screenSpacePo int, std::vector<LayerImpl*>& renderSurfaceLayerList);
30 33
31 template<typename LayerType> static bool renderSurfaceContributesToTarget(La yerType*, int targetSurfaceLayerID); 34 template<typename LayerType> static bool renderSurfaceContributesToTarget(La yerType*, int targetSurfaceLayerID);
32 35
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 for (size_t i = 0; i < rootLayer->children().size(); ++i) { 90 for (size_t i = 0; i < rootLayer->children().size(); ++i) {
88 if (LayerType* found = findLayerInSubtree(getChildAsRawPtr(rootLayer->ch ildren(), i), layerId)) 91 if (LayerType* found = findLayerInSubtree(getChildAsRawPtr(rootLayer->ch ildren(), i), layerId))
89 return found; 92 return found;
90 } 93 }
91 return 0; 94 return 0;
92 } 95 }
93 96
94 } // namespace cc 97 } // namespace cc
95 98
96 #endif // CC_LAYER_TREE_HOST_COMMON_H_ 99 #endif // CC_LAYER_TREE_HOST_COMMON_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698