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

Side by Side Diff: cc/layer_tree_host_common.h

Issue 11365025: Make cc a component (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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
« no previous file with comments | « cc/layer_tree_host.h ('k') | cc/layer_tree_host_impl.h » ('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/cc_export.h"
9 #include "cc/scoped_ptr_vector.h" 10 #include "cc/scoped_ptr_vector.h"
10 #include "ui/gfx/rect.h" 11 #include "ui/gfx/rect.h"
11 #include "IntSize.h" 12 #include "IntSize.h"
12 #include <public/WebTransformationMatrix.h> 13 #include <public/WebTransformationMatrix.h>
13 14
14 namespace cc { 15 namespace cc {
15 16
16 class LayerImpl; 17 class LayerImpl;
17 class LayerSorter; 18 class LayerSorter;
18 class Layer; 19 class Layer;
19 20
20 class LayerTreeHostCommon { 21 class CC_EXPORT LayerTreeHostCommon {
21 public: 22 public:
22 static gfx::Rect calculateVisibleRect(const gfx::Rect& targetSurfaceRect, co nst gfx::Rect& layerBoundRect, const WebKit::WebTransformationMatrix&); 23 static gfx::Rect calculateVisibleRect(const gfx::Rect& targetSurfaceRect, co nst gfx::Rect& layerBoundRect, const WebKit::WebTransformationMatrix&);
23 24
24 static void calculateDrawTransforms(Layer* rootLayer, const gfx::Size& devic eViewportSize, float deviceScaleFactor, float pageScaleFactor, int maxTextureSiz e, std::vector<scoped_refptr<Layer> >& renderSurfaceLayerList); 25 static void calculateDrawTransforms(Layer* rootLayer, const gfx::Size& devic eViewportSize, float deviceScaleFactor, float pageScaleFactor, int maxTextureSiz e, std::vector<scoped_refptr<Layer> >& renderSurfaceLayerList);
25 static void calculateDrawTransforms(LayerImpl* rootLayer, const gfx::Size& d eviceViewportSize, float deviceScaleFactor, float pageScaleFactor, LayerSorter*, int maxTextureSize, std::vector<LayerImpl*>& renderSurfaceLayerList); 26 static void calculateDrawTransforms(LayerImpl* rootLayer, const gfx::Size& d eviceViewportSize, float deviceScaleFactor, float pageScaleFactor, LayerSorter*, int maxTextureSize, std::vector<LayerImpl*>& renderSurfaceLayerList);
26 27
27 // Performs hit testing for a given renderSurfaceLayerList. 28 // Performs hit testing for a given renderSurfaceLayerList.
28 static LayerImpl* findLayerThatIsHitByPoint(const gfx::PointF& screenSpacePo int, std::vector<LayerImpl*>& renderSurfaceLayerList); 29 static LayerImpl* findLayerThatIsHitByPoint(const gfx::PointF& screenSpacePo int, std::vector<LayerImpl*>& renderSurfaceLayerList);
29 30
30 template<typename LayerType> static bool renderSurfaceContributesToTarget(La yerType*, int targetSurfaceLayerID); 31 template<typename LayerType> static bool renderSurfaceContributesToTarget(La yerType*, int targetSurfaceLayerID);
(...skipping 11 matching lines...) Expand all
42 { 43 {
43 return children[index]; 44 return children[index];
44 } 45 }
45 46
46 struct ScrollUpdateInfo { 47 struct ScrollUpdateInfo {
47 int layerId; 48 int layerId;
48 IntSize scrollDelta; 49 IntSize scrollDelta;
49 }; 50 };
50 }; 51 };
51 52
52 struct ScrollAndScaleSet { 53 struct CC_EXPORT ScrollAndScaleSet {
53 ScrollAndScaleSet(); 54 ScrollAndScaleSet();
54 ~ScrollAndScaleSet(); 55 ~ScrollAndScaleSet();
55 56
56 std::vector<LayerTreeHostCommon::ScrollUpdateInfo> scrolls; 57 std::vector<LayerTreeHostCommon::ScrollUpdateInfo> scrolls;
57 float pageScaleDelta; 58 float pageScaleDelta;
58 }; 59 };
59 60
60 template<typename LayerType> 61 template<typename LayerType>
61 bool LayerTreeHostCommon::renderSurfaceContributesToTarget(LayerType* layer, int targetSurfaceLayerID) 62 bool LayerTreeHostCommon::renderSurfaceContributesToTarget(LayerType* layer, int targetSurfaceLayerID)
62 { 63 {
(...skipping 23 matching lines...) Expand all
86 for (size_t i = 0; i < rootLayer->children().size(); ++i) { 87 for (size_t i = 0; i < rootLayer->children().size(); ++i) {
87 if (LayerType* found = findLayerInSubtree(getChildAsRawPtr(rootLayer->ch ildren(), i), layerId)) 88 if (LayerType* found = findLayerInSubtree(getChildAsRawPtr(rootLayer->ch ildren(), i), layerId))
88 return found; 89 return found;
89 } 90 }
90 return 0; 91 return 0;
91 } 92 }
92 93
93 } // namespace cc 94 } // namespace cc
94 95
95 #endif 96 #endif
OLDNEW
« no previous file with comments | « cc/layer_tree_host.h ('k') | cc/layer_tree_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698