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

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

Issue 690063002: cc: Do not ignore layers without valid priorities during eviction. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase: CreateWith{Pile => RasterSource} Created 6 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
« no previous file with comments | « cc/resources/tile_manager_unittest.cc ('k') | cc/test/fake_picture_layer_tiling_client.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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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_TILING_CLIENT_H_ 5 #ifndef CC_TEST_FAKE_PICTURE_LAYER_TILING_CLIENT_H_
6 #define CC_TEST_FAKE_PICTURE_LAYER_TILING_CLIENT_H_ 6 #define CC_TEST_FAKE_PICTURE_LAYER_TILING_CLIENT_H_
7 7
8 #include "cc/resources/picture_layer_tiling.h" 8 #include "cc/resources/picture_layer_tiling.h"
9 #include "cc/resources/picture_pile_impl.h" 9 #include "cc/resources/picture_pile_impl.h"
10 #include "cc/resources/tile.h" 10 #include "cc/resources/tile.h"
11 #include "cc/resources/tile_manager.h" 11 #include "cc/resources/tile_manager.h"
12 #include "cc/test/fake_tile_manager_client.h" 12 #include "cc/test/fake_tile_manager_client.h"
13 #include "ui/gfx/geometry/rect.h" 13 #include "ui/gfx/geometry/rect.h"
14 14
15 namespace cc { 15 namespace cc {
16 16
17 class FakePictureLayerTilingClient : public PictureLayerTilingClient { 17 class FakePictureLayerTilingClient : public PictureLayerTilingClient {
18 public: 18 public:
19 FakePictureLayerTilingClient(); 19 FakePictureLayerTilingClient();
20 explicit FakePictureLayerTilingClient(ResourceProvider* resource_provider); 20 explicit FakePictureLayerTilingClient(ResourceProvider* resource_provider);
21 ~FakePictureLayerTilingClient() override; 21 ~FakePictureLayerTilingClient() override;
22 22
23 // PictureLayerTilingClient implementation. 23 // PictureLayerTilingClient implementation.
24 scoped_refptr<Tile> CreateTile(PictureLayerTiling* tiling, 24 scoped_refptr<Tile> CreateTile(PictureLayerTiling* tiling,
25 const gfx::Rect& rect) override; 25 const gfx::Rect& rect) override;
26 RasterSource* GetRasterSource() override; 26 RasterSource* GetRasterSource() override;
27 gfx::Size CalculateTileSize(const gfx::Size& content_bounds) const override; 27 gfx::Size CalculateTileSize(const gfx::Size& content_bounds) const override;
28 TilePriority::PriorityBin GetMaxTilePriorityBin() const override;
28 size_t GetMaxTilesForInterestArea() const override; 29 size_t GetMaxTilesForInterestArea() const override;
29 float GetSkewportTargetTimeInSeconds() const override; 30 float GetSkewportTargetTimeInSeconds() const override;
30 int GetSkewportExtrapolationLimitInContentPixels() const override; 31 int GetSkewportExtrapolationLimitInContentPixels() const override;
31 bool RequiresHighResToDraw() const override; 32 bool RequiresHighResToDraw() const override;
32 33
33 void SetTileSize(const gfx::Size& tile_size); 34 void SetTileSize(const gfx::Size& tile_size);
34 gfx::Size TileSize() const { return tile_size_; } 35 gfx::Size TileSize() const { return tile_size_; }
35 36
36 const Region* GetPendingInvalidation() override; 37 const Region* GetPendingInvalidation() override;
37 const PictureLayerTiling* GetPendingOrActiveTwinTiling( 38 const PictureLayerTiling* GetPendingOrActiveTwinTiling(
38 const PictureLayerTiling* tiling) const override; 39 const PictureLayerTiling* tiling) const override;
39 PictureLayerTiling* GetRecycledTwinTiling( 40 PictureLayerTiling* GetRecycledTwinTiling(
40 const PictureLayerTiling* tiling) override; 41 const PictureLayerTiling* tiling) override;
41 WhichTree GetTree() const override; 42 WhichTree GetTree() const override;
42 43
43 void set_twin_tiling(PictureLayerTiling* tiling) { twin_tiling_ = tiling; } 44 void set_twin_tiling(PictureLayerTiling* tiling) { twin_tiling_ = tiling; }
44 void set_recycled_twin_tiling(PictureLayerTiling* tiling) { 45 void set_recycled_twin_tiling(PictureLayerTiling* tiling) {
45 recycled_twin_tiling_ = tiling; 46 recycled_twin_tiling_ = tiling;
46 } 47 }
47 void set_text_rect(const gfx::Rect& rect) { text_rect_ = rect; } 48 void set_text_rect(const gfx::Rect& rect) { text_rect_ = rect; }
48 void set_allow_create_tile(bool allow) { allow_create_tile_ = allow; } 49 void set_allow_create_tile(bool allow) { allow_create_tile_ = allow; }
49 void set_invalidation(const Region& region) { invalidation_ = region; } 50 void set_invalidation(const Region& region) { invalidation_ = region; }
51 void set_max_tile_priority_bin(TilePriority::PriorityBin bin) {
52 max_tile_priority_bin_ = bin;
53 }
50 void set_max_tiles_for_interest_area(size_t area) { 54 void set_max_tiles_for_interest_area(size_t area) {
51 max_tiles_for_interest_area_ = area; 55 max_tiles_for_interest_area_ = area;
52 } 56 }
53 void set_skewport_target_time_in_seconds(float time) { 57 void set_skewport_target_time_in_seconds(float time) {
54 skewport_target_time_in_seconds_ = time; 58 skewport_target_time_in_seconds_ = time;
55 } 59 }
56 void set_skewport_extrapolation_limit_in_content_pixels(int limit) { 60 void set_skewport_extrapolation_limit_in_content_pixels(int limit) {
57 skewport_extrapolation_limit_in_content_pixels_ = limit; 61 skewport_extrapolation_limit_in_content_pixels_ = limit;
58 } 62 }
59 void set_tree(WhichTree tree) { tree_ = tree; } 63 void set_tree(WhichTree tree) { tree_ = tree; }
60 64
61 TileManager* tile_manager() const { 65 TileManager* tile_manager() const {
62 return tile_manager_.get(); 66 return tile_manager_.get();
63 } 67 }
64 68
65 protected: 69 protected:
66 FakeTileManagerClient tile_manager_client_; 70 FakeTileManagerClient tile_manager_client_;
67 scoped_ptr<ResourcePool> resource_pool_; 71 scoped_ptr<ResourcePool> resource_pool_;
68 scoped_ptr<TileManager> tile_manager_; 72 scoped_ptr<TileManager> tile_manager_;
69 scoped_refptr<PicturePileImpl> pile_; 73 scoped_refptr<PicturePileImpl> pile_;
70 gfx::Size tile_size_; 74 gfx::Size tile_size_;
71 PictureLayerTiling* twin_tiling_; 75 PictureLayerTiling* twin_tiling_;
72 PictureLayerTiling* recycled_twin_tiling_; 76 PictureLayerTiling* recycled_twin_tiling_;
73 gfx::Rect text_rect_; 77 gfx::Rect text_rect_;
74 bool allow_create_tile_; 78 bool allow_create_tile_;
75 Region invalidation_; 79 Region invalidation_;
80 TilePriority::PriorityBin max_tile_priority_bin_;
76 size_t max_tiles_for_interest_area_; 81 size_t max_tiles_for_interest_area_;
77 float skewport_target_time_in_seconds_; 82 float skewport_target_time_in_seconds_;
78 int skewport_extrapolation_limit_in_content_pixels_; 83 int skewport_extrapolation_limit_in_content_pixels_;
79 WhichTree tree_; 84 WhichTree tree_;
80 }; 85 };
81 86
82 } // namespace cc 87 } // namespace cc
83 88
84 #endif // CC_TEST_FAKE_PICTURE_LAYER_TILING_CLIENT_H_ 89 #endif // CC_TEST_FAKE_PICTURE_LAYER_TILING_CLIENT_H_
OLDNEW
« no previous file with comments | « cc/resources/tile_manager_unittest.cc ('k') | cc/test/fake_picture_layer_tiling_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698