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

Side by Side Diff: cc/resources/managed_tile_state.h

Issue 12642010: Implement on demand quad rasterization for PicturePiles. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase & introduce ResizeResource. Created 7 years, 9 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
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_RESOURCES_MANAGED_TILE_STATE_H_ 5 #ifndef CC_RESOURCES_MANAGED_TILE_STATE_H_
6 #define CC_RESOURCES_MANAGED_TILE_STATE_H_ 6 #define CC_RESOURCES_MANAGED_TILE_STATE_H_
7 7
8 #include <list> 8 #include <list>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 } 60 }
61 61
62 scoped_ptr<ResourcePool::Resource>& GetResourceForTesting() { 62 scoped_ptr<ResourcePool::Resource>& GetResourceForTesting() {
63 return resource_; 63 return resource_;
64 } 64 }
65 65
66 private: 66 private:
67 friend class TileManager; 67 friend class TileManager;
68 friend class ManagedTileState; 68 friend class ManagedTileState;
69 69
70 void set_texture() {
71 mode_ = TEXTURE_MODE;
72 }
73
70 void set_transparent() { 74 void set_transparent() {
71 mode_ = TRANSPARENT_MODE; 75 mode_ = TRANSPARENT_MODE;
72 } 76 }
73 77
74 void set_solid_color(const SkColor& color) { 78 void set_solid_color(const SkColor& color) {
75 mode_ = SOLID_COLOR_MODE; 79 mode_ = SOLID_COLOR_MODE;
76 solid_color_ = color; 80 solid_color_ = color;
77 } 81 }
78 82
83 void set_rasterize_on_demand() {
84 mode_ = PICTURE_PILE_MODE;
85 }
86
79 Mode mode_; 87 Mode mode_;
80 SkColor solid_color_; 88 SkColor solid_color_;
81 89
82 scoped_ptr<ResourcePool::Resource> resource_; 90 scoped_ptr<ResourcePool::Resource> resource_;
83 bool resource_is_being_initialized_; 91 bool resource_is_being_initialized_;
84 bool can_be_freed_; 92 bool can_be_freed_;
85 bool contents_swizzled_; 93 bool contents_swizzled_;
86 }; 94 };
87 95
88 96
(...skipping 19 matching lines...) Expand all
108 // to determine policy. 116 // to determine policy.
109 TileManagerBin gpu_memmgr_stats_bin; 117 TileManagerBin gpu_memmgr_stats_bin;
110 TileResolution resolution; 118 TileResolution resolution;
111 float time_to_needed_in_seconds; 119 float time_to_needed_in_seconds;
112 float distance_to_visible_in_pixels; 120 float distance_to_visible_in_pixels;
113 }; 121 };
114 122
115 } // namespace cc 123 } // namespace cc
116 124
117 #endif // CC_RESOURCES_MANAGED_TILE_STATE_H_ 125 #endif // CC_RESOURCES_MANAGED_TILE_STATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698