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

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

Issue 15715031: cc: Remove memory state from tile management (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update Created 7 years, 6 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
« no previous file with comments | « cc/resources/resource_pool.h ('k') | cc/resources/tile_manager.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_RESOURCES_TILE_H_ 5 #ifndef CC_RESOURCES_TILE_H_
6 #define CC_RESOURCES_TILE_H_ 6 #define CC_RESOURCES_TILE_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 "base/memory/scoped_vector.h" 10 #include "base/memory/scoped_vector.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 75
76 int layer_id() const { return layer_id_; } 76 int layer_id() const { return layer_id_; }
77 77
78 int source_frame_number() const { return source_frame_number_; } 78 int source_frame_number() const { return source_frame_number_; }
79 79
80 void set_picture_pile(scoped_refptr<PicturePileImpl> pile) { 80 void set_picture_pile(scoped_refptr<PicturePileImpl> pile) {
81 DCHECK(pile->CanRaster(contents_scale_, content_rect_)); 81 DCHECK(pile->CanRaster(contents_scale_, content_rect_));
82 picture_pile_ = pile; 82 picture_pile_ = pile;
83 } 83 }
84 84
85 bool IsAssignedGpuMemory() const { 85 // For test only methods.
86 return tile_version().memory_state_ != NOT_ALLOWED_TO_USE_MEMORY; 86 bool HasRasterTaskForTesting() const {
87 return !managed_state().raster_task.is_null();
88 }
89 void ResetRasterTaskForTesting() {
90 managed_state().raster_task.Reset();
87 } 91 }
88 92
89 private: 93 private:
90 // Methods called by by tile manager. 94 // Methods called by by tile manager.
91 friend class TileManager; 95 friend class TileManager;
92 friend class BinComparator; 96 friend class BinComparator;
93 ManagedTileState& managed_state() { return managed_state_; } 97 ManagedTileState& managed_state() { return managed_state_; }
94 const ManagedTileState& managed_state() const { return managed_state_; } 98 const ManagedTileState& managed_state() const { return managed_state_; }
95 99
96 inline size_t bytes_consumed_if_allocated() const { 100 inline size_t bytes_consumed_if_allocated() const {
(...skipping 16 matching lines...) Expand all
113 ManagedTileState managed_state_; 117 ManagedTileState managed_state_;
114 int layer_id_; 118 int layer_id_;
115 int source_frame_number_; 119 int source_frame_number_;
116 120
117 DISALLOW_COPY_AND_ASSIGN(Tile); 121 DISALLOW_COPY_AND_ASSIGN(Tile);
118 }; 122 };
119 123
120 } // namespace cc 124 } // namespace cc
121 125
122 #endif // CC_RESOURCES_TILE_H_ 126 #endif // CC_RESOURCES_TILE_H_
OLDNEW
« no previous file with comments | « cc/resources/resource_pool.h ('k') | cc/resources/tile_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698