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

Side by Side Diff: cc/test/fake_picture_layer_impl.h

Issue 235753002: cc: Give TilingData a Rect instead of a Size (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Git cl format Created 6 years, 8 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/resources/tile_manager.cc ('k') | cc/test/fake_picture_layer_impl.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_TEST_FAKE_PICTURE_LAYER_IMPL_H_ 5 #ifndef CC_TEST_FAKE_PICTURE_LAYER_IMPL_H_
6 #define CC_TEST_FAKE_PICTURE_LAYER_IMPL_H_ 6 #define CC_TEST_FAKE_PICTURE_LAYER_IMPL_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "cc/layers/picture_layer_impl.h" 9 #include "cc/layers/picture_layer_impl.h"
10 10
11 namespace cc { 11 namespace cc {
12 12
13 class FakePictureLayerImpl : public PictureLayerImpl { 13 class FakePictureLayerImpl : public PictureLayerImpl {
14 public: 14 public:
15 static scoped_ptr<FakePictureLayerImpl> Create( 15 static scoped_ptr<FakePictureLayerImpl> Create(
16 LayerTreeImpl* tree_impl, int id) { 16 LayerTreeImpl* tree_impl, int id) {
17 return make_scoped_ptr(new FakePictureLayerImpl(tree_impl, id)); 17 return make_scoped_ptr(new FakePictureLayerImpl(tree_impl, id));
18 } 18 }
19 19
20 // Create layer from a pile that covers the entire layer.
20 static scoped_ptr<FakePictureLayerImpl> CreateWithPile( 21 static scoped_ptr<FakePictureLayerImpl> CreateWithPile(
21 LayerTreeImpl* tree_impl, int id, scoped_refptr<PicturePileImpl> pile) { 22 LayerTreeImpl* tree_impl, int id, scoped_refptr<PicturePileImpl> pile) {
22 return make_scoped_ptr(new FakePictureLayerImpl(tree_impl, id, pile)); 23 return make_scoped_ptr(new FakePictureLayerImpl(tree_impl, id, pile));
23 } 24 }
24 25
26 // Create layer from a pile that only covers part of the layer.
27 static scoped_ptr<FakePictureLayerImpl> CreateWithPartialPile(
28 LayerTreeImpl* tree_impl,
29 int id,
30 scoped_refptr<PicturePileImpl> pile,
31 const gfx::Size& layer_bounds) {
32 return make_scoped_ptr(
33 new FakePictureLayerImpl(tree_impl, id, pile, layer_bounds));
34 }
35
25 virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) 36 virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl)
26 OVERRIDE; 37 OVERRIDE;
27 virtual void AppendQuads(QuadSink* quad_sink, 38 virtual void AppendQuads(QuadSink* quad_sink,
28 AppendQuadsData* append_quads_data) OVERRIDE; 39 AppendQuadsData* append_quads_data) OVERRIDE;
29 virtual gfx::Size CalculateTileSize( 40 virtual gfx::Size CalculateTileSize(
30 const gfx::Size& content_bounds) const OVERRIDE; 41 const gfx::Size& content_bounds) const OVERRIDE;
31 42
32 using PictureLayerImpl::AddTiling; 43 using PictureLayerImpl::AddTiling;
33 using PictureLayerImpl::CleanUpTilingsOnActiveLayer; 44 using PictureLayerImpl::CleanUpTilingsOnActiveLayer;
34 using PictureLayerImpl::CanHaveTilings; 45 using PictureLayerImpl::CanHaveTilings;
(...skipping 27 matching lines...) Expand all
62 void SetAllTilesVisible(); 73 void SetAllTilesVisible();
63 void SetAllTilesReady(); 74 void SetAllTilesReady();
64 void SetAllTilesReadyInTiling(PictureLayerTiling* tiling); 75 void SetAllTilesReadyInTiling(PictureLayerTiling* tiling);
65 void ResetAllTilesPriorities(); 76 void ResetAllTilesPriorities();
66 77
67 protected: 78 protected:
68 FakePictureLayerImpl( 79 FakePictureLayerImpl(
69 LayerTreeImpl* tree_impl, 80 LayerTreeImpl* tree_impl,
70 int id, 81 int id,
71 scoped_refptr<PicturePileImpl> pile); 82 scoped_refptr<PicturePileImpl> pile);
83 FakePictureLayerImpl(LayerTreeImpl* tree_impl,
84 int id,
85 scoped_refptr<PicturePileImpl> pile,
86 const gfx::Size& layer_bounds);
72 FakePictureLayerImpl(LayerTreeImpl* tree_impl, int id); 87 FakePictureLayerImpl(LayerTreeImpl* tree_impl, int id);
73 88
74 private: 89 private:
75 gfx::Size fixed_tile_size_; 90 gfx::Size fixed_tile_size_;
76 91
77 size_t append_quads_count_; 92 size_t append_quads_count_;
78 }; 93 };
79 94
80 } // namespace cc 95 } // namespace cc
81 96
82 #endif // CC_TEST_FAKE_PICTURE_LAYER_IMPL_H_ 97 #endif // CC_TEST_FAKE_PICTURE_LAYER_IMPL_H_
OLDNEW
« no previous file with comments | « cc/resources/tile_manager.cc ('k') | cc/test/fake_picture_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698