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

Side by Side Diff: cc/picture_pile_base.h

Issue 12221077: Fixing tile grid size used by cc:Picture to make it respect current tile configuration (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: response to comments 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/picture_pile.cc ('k') | cc/picture_pile_base.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_PICTURE_PILE_BASE_H_ 5 #ifndef CC_PICTURE_PILE_BASE_H_
6 #define CC_PICTURE_PILE_BASE_H_ 6 #define CC_PICTURE_PILE_BASE_H_
7 7
8 #include <list> 8 #include <list>
9 9
10 #include "base/hash_tables.h" 10 #include "base/hash_tables.h"
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "cc/cc_export.h" 12 #include "cc/cc_export.h"
13 #include "cc/hash_pair.h" 13 #include "cc/hash_pair.h"
14 #include "cc/picture.h" 14 #include "cc/picture.h"
15 #include "cc/region.h" 15 #include "cc/region.h"
16 #include "cc/tiling_data.h" 16 #include "cc/tiling_data.h"
17 #include "ui/gfx/size.h" 17 #include "ui/gfx/size.h"
18 18
19 namespace cc { 19 namespace cc {
20 20
21 class LayerTreeSettings;
22
21 class CC_EXPORT PicturePileBase : public base::RefCounted<PicturePileBase> { 23 class CC_EXPORT PicturePileBase : public base::RefCounted<PicturePileBase> {
22 public: 24 public:
23 PicturePileBase(); 25 PicturePileBase();
24 26
25 void Resize(gfx::Size size); 27 void Resize(gfx::Size size);
26 gfx::Size size() const { return tiling_.total_size(); } 28 gfx::Size size() const { return tiling_.total_size(); }
27 void SetMinContentsScale(float min_contents_scale); 29 void SetMinContentsScale(float min_contents_scale);
28 30
29 void PushPropertiesTo(PicturePileBase* other); 31 void PushPropertiesTo(PicturePileBase* other);
30 32
31 void UpdateRecordedRegion(); 33 void UpdateRecordedRegion();
32 const Region& recorded_region() const { return recorded_region_; } 34 const Region& recorded_region() const { return recorded_region_; }
33 35
34 int num_tiles_x() const { return tiling_.num_tiles_x(); } 36 int num_tiles_x() const { return tiling_.num_tiles_x(); }
35 int num_tiles_y() const { return tiling_.num_tiles_y(); } 37 int num_tiles_y() const { return tiling_.num_tiles_y(); }
36 gfx::Rect tile_bounds(int x, int y) const { return tiling_.TileBounds(x, y); } 38 gfx::Rect tile_bounds(int x, int y) const { return tiling_.TileBounds(x, y); }
37 bool HasRecordingAt(int x, int y); 39 bool HasRecordingAt(int x, int y);
38 40
41 void ApplyLayerTreeSettings(const LayerTreeSettings& settings);
enne (OOO) 2013/02/26 18:12:25 Sorry, I should have been more clear. I don't thi
42
39 protected: 43 protected:
40 virtual ~PicturePileBase(); 44 virtual ~PicturePileBase();
41 45
42 int buffer_pixels() const { return tiling_.border_texels(); } 46 int buffer_pixels() const { return tiling_.border_texels(); }
43 void Clear(); 47 void Clear();
44 48
45 typedef std::pair<int, int> PictureListMapKey; 49 typedef std::pair<int, int> PictureListMapKey;
46 typedef std::list<scoped_refptr<Picture> > PictureList; 50 typedef std::list<scoped_refptr<Picture> > PictureList;
47 typedef base::hash_map<PictureListMapKey, PictureList> PictureListMap; 51 typedef base::hash_map<PictureListMapKey, PictureList> PictureListMap;
48 52
49 // A picture pile is a tiled set of picture lists. The picture list map 53 // A picture pile is a tiled set of picture lists. The picture list map
50 // is a map of tile indices to picture lists. 54 // is a map of tile indices to picture lists.
51 PictureListMap picture_list_map_; 55 PictureListMap picture_list_map_;
52 TilingData tiling_; 56 TilingData tiling_;
53 Region recorded_region_; 57 Region recorded_region_;
54 float min_contents_scale_; 58 float min_contents_scale_;
59 SkTileGridPicture::TileGridInfo tile_grid_info_;
55 60
56 private: 61 private:
57 void SetBufferPixels(int buffer_pixels); 62 void SetBufferPixels(int buffer_pixels);
58 63
59 friend class base::RefCounted<PicturePileBase>; 64 friend class base::RefCounted<PicturePileBase>;
60 DISALLOW_COPY_AND_ASSIGN(PicturePileBase); 65 DISALLOW_COPY_AND_ASSIGN(PicturePileBase);
61 }; 66 };
62 67
63 } // namespace cc 68 } // namespace cc
64 69
65 #endif // CC_PICTURE_PILE_H_ 70 #endif // CC_PICTURE_PILE_H_
OLDNEW
« no previous file with comments | « cc/picture_pile.cc ('k') | cc/picture_pile_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698