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

Side by Side Diff: cc/layers/picture_layer_impl.h

Issue 519583003: Use the solid color detection to create solid layers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
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_LAYERS_PICTURE_LAYER_IMPL_H_ 5 #ifndef CC_LAYERS_PICTURE_LAYER_IMPL_H_
6 #define CC_LAYERS_PICTURE_LAYER_IMPL_H_ 6 #define CC_LAYERS_PICTURE_LAYER_IMPL_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 143
144 virtual void RunMicroBenchmark(MicroBenchmarkImpl* benchmark) OVERRIDE; 144 virtual void RunMicroBenchmark(MicroBenchmarkImpl* benchmark) OVERRIDE;
145 145
146 // Functions used by tile manager. 146 // Functions used by tile manager.
147 PictureLayerImpl* GetTwinLayer() { return twin_layer_; } 147 PictureLayerImpl* GetTwinLayer() { return twin_layer_; }
148 bool IsOnActiveOrPendingTree() const; 148 bool IsOnActiveOrPendingTree() const;
149 // Virtual for testing. 149 // Virtual for testing.
150 virtual bool HasValidTilePriorities() const; 150 virtual bool HasValidTilePriorities() const;
151 bool AllTilesRequiredForActivationAreReadyToDraw() const; 151 bool AllTilesRequiredForActivationAreReadyToDraw() const;
152 152
153 void SetSolidColorState(bool is_solid_color, SkColor solid_color);
154 bool IsSolidColor() const { return is_solid_color_; }
155
153 protected: 156 protected:
154 friend class LayerRasterTileIterator; 157 friend class LayerRasterTileIterator;
155 158
156 PictureLayerImpl(LayerTreeImpl* tree_impl, int id); 159 PictureLayerImpl(LayerTreeImpl* tree_impl, int id);
157 PictureLayerTiling* AddTiling(float contents_scale); 160 PictureLayerTiling* AddTiling(float contents_scale);
158 void RemoveTiling(float contents_scale); 161 void RemoveTiling(float contents_scale);
159 void RemoveAllTilings(); 162 void RemoveAllTilings();
160 void SyncFromActiveLayer(const PictureLayerImpl* other); 163 void SyncFromActiveLayer(const PictureLayerImpl* other);
161 void AddTilingsForRasterScale(); 164 void AddTilingsForRasterScale();
162 void UpdateTilePriorities( 165 void UpdateTilePriorities(
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 // A sanity state check to make sure UpdateTilePriorities only gets called 227 // A sanity state check to make sure UpdateTilePriorities only gets called
225 // after a CalculateContentsScale/ManageTilings. 228 // after a CalculateContentsScale/ManageTilings.
226 bool should_update_tile_priorities_; 229 bool should_update_tile_priorities_;
227 230
228 // Save a copy of the visible rect and viewport size of the last frame that 231 // Save a copy of the visible rect and viewport size of the last frame that
229 // has a valid viewport for prioritizing tiles. 232 // has a valid viewport for prioritizing tiles.
230 gfx::Rect visible_rect_for_tile_priority_; 233 gfx::Rect visible_rect_for_tile_priority_;
231 gfx::Rect viewport_rect_for_tile_priority_; 234 gfx::Rect viewport_rect_for_tile_priority_;
232 gfx::Transform screen_space_transform_for_tile_priority_; 235 gfx::Transform screen_space_transform_for_tile_priority_;
233 236
237 bool is_solid_color_;
238 SkColor solid_color_;
239
234 friend class PictureLayer; 240 friend class PictureLayer;
235 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); 241 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl);
236 }; 242 };
237 243
238 } // namespace cc 244 } // namespace cc
239 245
240 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_ 246 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698