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

Side by Side Diff: cc/layer_updater.h

Issue 12095053: cc: Avoid expensive RenderingStats collection. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits Created 7 years, 10 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_settings.cc ('k') | cc/nine_patch_layer.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 CC_LAYER_UPDATER_H_ 5 #ifndef CC_LAYER_UPDATER_H_
6 #define CC_LAYER_UPDATER_H_ 6 #define CC_LAYER_UPDATER_H_
7 7
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "cc/cc_export.h" 10 #include "cc/cc_export.h"
(...skipping 16 matching lines...) Expand all
27 public: 27 public:
28 // Allows updaters to store per-resource update properties. 28 // Allows updaters to store per-resource update properties.
29 class CC_EXPORT Resource { 29 class CC_EXPORT Resource {
30 public: 30 public:
31 virtual ~Resource(); 31 virtual ~Resource();
32 32
33 PrioritizedResource* texture() { return m_texture.get(); } 33 PrioritizedResource* texture() { return m_texture.get(); }
34 void swapTextureWith(scoped_ptr<PrioritizedResource>& texture); 34 void swapTextureWith(scoped_ptr<PrioritizedResource>& texture);
35 // TODO(reveman): partialUpdate should be a property of this class 35 // TODO(reveman): partialUpdate should be a property of this class
36 // instead of an argument passed to update(). 36 // instead of an argument passed to update().
37 virtual void update(ResourceUpdateQueue&, const gfx::Rect& sourceRect, c onst gfx::Vector2d& destOffset, bool partialUpdate, RenderingStats&) = 0; 37 virtual void update(ResourceUpdateQueue&, const gfx::Rect& sourceRect, c onst gfx::Vector2d& destOffset, bool partialUpdate, RenderingStats*) = 0;
38 protected: 38 protected:
39 explicit Resource(scoped_ptr<PrioritizedResource> texture); 39 explicit Resource(scoped_ptr<PrioritizedResource> texture);
40 40
41 private: 41 private:
42 scoped_ptr<PrioritizedResource> m_texture; 42 scoped_ptr<PrioritizedResource> m_texture;
43 43
44 DISALLOW_COPY_AND_ASSIGN(Resource); 44 DISALLOW_COPY_AND_ASSIGN(Resource);
45 }; 45 };
46 46
47 LayerUpdater() { } 47 LayerUpdater() { }
48 48
49 virtual scoped_ptr<Resource> createResource(PrioritizedResourceManager*) = 0 ; 49 virtual scoped_ptr<Resource> createResource(PrioritizedResourceManager*) = 0 ;
50 // The |resultingOpaqueRect| gives back a region of the layer that was paint ed opaque. If the layer is marked opaque in the updater, 50 // The |resultingOpaqueRect| gives back a region of the layer that was paint ed opaque. If the layer is marked opaque in the updater,
51 // then this region should be ignored in preference for the entire layer's a rea. 51 // then this region should be ignored in preference for the entire layer's a rea.
52 virtual void prepareToUpdate(const gfx::Rect& contentRect, const gfx::Size& tileSize, float contentsWidthScale, float contentsHeightScale, gfx::Rect& result ingOpaqueRect, RenderingStats&) { } 52 virtual void prepareToUpdate(const gfx::Rect& contentRect, const gfx::Size& tileSize, float contentsWidthScale, float contentsHeightScale, gfx::Rect& result ingOpaqueRect, RenderingStats*) { }
53 53
54 // Set true by the layer when it is known that the entire output is going to be opaque. 54 // Set true by the layer when it is known that the entire output is going to be opaque.
55 virtual void setOpaque(bool) { } 55 virtual void setOpaque(bool) { }
56 56
57 protected: 57 protected:
58 virtual ~LayerUpdater() { } 58 virtual ~LayerUpdater() { }
59 59
60 private: 60 private:
61 friend class base::RefCounted<LayerUpdater>; 61 friend class base::RefCounted<LayerUpdater>;
62 }; 62 };
63 63
64 } // namespace cc 64 } // namespace cc
65 65
66 #endif // CC_LAYER_UPDATER_H_ 66 #endif // CC_LAYER_UPDATER_H_
OLDNEW
« no previous file with comments | « cc/layer_tree_settings.cc ('k') | cc/nine_patch_layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698