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

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

Issue 13939005: cc: Add strict layer property change checking and handle bounds changes during paint. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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
OLDNEW
1 // Copyright 2010 The Chromium Authors. All rights reserved. 1 // Copyright 2010 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_LAYER_H_ 5 #ifndef CC_LAYERS_LAYER_H_
6 #define CC_LAYERS_LAYER_H_ 6 #define CC_LAYERS_LAYER_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 const Layer* replica_layer() const { return replica_layer_.get(); } 261 const Layer* replica_layer() const { return replica_layer_.get(); }
262 262
263 bool has_mask() const { return !!mask_layer_; } 263 bool has_mask() const { return !!mask_layer_; }
264 bool has_replica() const { return !!replica_layer_; } 264 bool has_replica() const { return !!replica_layer_; }
265 bool replica_has_mask() const { 265 bool replica_has_mask() const {
266 return replica_layer_ && (mask_layer_ || replica_layer_->mask_layer_); 266 return replica_layer_ && (mask_layer_ || replica_layer_->mask_layer_);
267 } 267 }
268 268
269 // These methods typically need to be overwritten by derived classes. 269 // These methods typically need to be overwritten by derived classes.
270 virtual bool DrawsContent() const; 270 virtual bool DrawsContent() const;
271 virtual void PrepareToUpdate();
271 virtual void Update(ResourceUpdateQueue* queue, 272 virtual void Update(ResourceUpdateQueue* queue,
272 const OcclusionTracker* occlusion, 273 const OcclusionTracker* occlusion,
273 RenderingStats* stats) {} 274 RenderingStats* stats) {}
274 virtual bool NeedMoreUpdates(); 275 virtual bool NeedMoreUpdates();
275 virtual void SetIsMask(bool is_mask) {} 276 virtual void SetIsMask(bool is_mask) {}
276 277
277 void SetDebugName(const std::string& debug_name); 278 void SetDebugName(const std::string& debug_name);
278 279
279 virtual void PushPropertiesTo(LayerImpl* layer); 280 virtual void PushPropertiesTo(LayerImpl* layer);
280 281
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 373
373 protected: 374 protected:
374 friend class LayerImpl; 375 friend class LayerImpl;
375 friend class TreeSynchronizer; 376 friend class TreeSynchronizer;
376 virtual ~Layer(); 377 virtual ~Layer();
377 378
378 Layer(); 379 Layer();
379 380
380 void SetNeedsCommit(); 381 void SetNeedsCommit();
381 void SetNeedsFullTreeSync(); 382 void SetNeedsFullTreeSync();
383 bool IsPropertyChangeAllowed() const;
382 384
383 // This flag is set when layer need repainting/updating. 385 // This flag is set when layer need repainting/updating.
384 bool needs_display_; 386 bool needs_display_;
385 387
386 // Tracks whether this layer may have changed stacking order with its 388 // Tracks whether this layer may have changed stacking order with its
387 // siblings. 389 // siblings.
388 bool stacking_order_changed_; 390 bool stacking_order_changed_;
389 391
390 // The update rect is the region of the compositor resource that was 392 // The update rect is the region of the compositor resource that was
391 // actually updated by the compositor. For layers that may do updating 393 // actually updated by the compositor. For layers that may do updating
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 // Replica layer used for reflections. 468 // Replica layer used for reflections.
467 scoped_refptr<Layer> replica_layer_; 469 scoped_refptr<Layer> replica_layer_;
468 470
469 // Transient properties. 471 // Transient properties.
470 float raster_scale_; 472 float raster_scale_;
471 bool automatically_compute_raster_scale_; 473 bool automatically_compute_raster_scale_;
472 bool bounds_contain_page_scale_; 474 bool bounds_contain_page_scale_;
473 475
474 gfx::Transform impl_transform_; 476 gfx::Transform impl_transform_;
475 477
478 // These properties that can change during Update().
479 gfx::Size last_bounds_;
480
476 WebKit::WebLayerScrollClient* layer_scroll_client_; 481 WebKit::WebLayerScrollClient* layer_scroll_client_;
477 482
478 DrawProperties<Layer, RenderSurface> draw_properties_; 483 DrawProperties<Layer, RenderSurface> draw_properties_;
479 484
480 DISALLOW_COPY_AND_ASSIGN(Layer); 485 DISALLOW_COPY_AND_ASSIGN(Layer);
481 }; 486 };
482 487
483 } // namespace cc 488 } // namespace cc
484 489
485 #endif // CC_LAYERS_LAYER_H_ 490 #endif // CC_LAYERS_LAYER_H_
OLDNEW
« no previous file with comments | « cc/base/switches.cc ('k') | cc/layers/layer.cc » ('j') | cc/layers/layer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698