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

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

Issue 19106007: cc: Allow the main thread to cancel commits (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add more comments Created 7 years, 4 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
« no previous file with comments | « no previous file | cc/layers/layer.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 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 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 return num_dependents_need_push_properties_ > 0; 387 return num_dependents_need_push_properties_ > 0;
388 } 388 }
389 389
390 protected: 390 protected:
391 friend class LayerImpl; 391 friend class LayerImpl;
392 friend class TreeSynchronizer; 392 friend class TreeSynchronizer;
393 virtual ~Layer(); 393 virtual ~Layer();
394 394
395 Layer(); 395 Layer();
396 396
397 // These SetNeeds functions are in order of severity of update:
398 //
399 // Called when this layer has been modified in some way, but isn't sure
400 // that it needs a commit yet. It needs CalcDrawProperties and UpdateLayers
401 // before it knows whether or not a commit is required.
402 void SetNeedsUpdate();
403 // Called when a property has been modified in a way that the layer
404 // knows immediately that a commit is required. This implies SetNeedsUpdate
405 // as well as SetNeedsPushProperties to push that property.
397 void SetNeedsCommit(); 406 void SetNeedsCommit();
407 // Called when there's been a change in layer structure. Implies both
408 // SetNeedsUpdate and SetNeedsCommit, but not SetNeedsPushProperties.
398 void SetNeedsFullTreeSync(); 409 void SetNeedsFullTreeSync();
399 bool IsPropertyChangeAllowed() const; 410 bool IsPropertyChangeAllowed() const;
400 411
401 void SetNeedsPushProperties(); 412 void SetNeedsPushProperties();
402 void AddDependentNeedsPushProperties(); 413 void AddDependentNeedsPushProperties();
403 void RemoveDependentNeedsPushProperties(); 414 void RemoveDependentNeedsPushProperties();
404 bool parent_should_know_need_push_properties() const { 415 bool parent_should_know_need_push_properties() const {
405 return needs_push_properties() || descendant_needs_push_properties(); 416 return needs_push_properties() || descendant_needs_push_properties();
406 } 417 }
407 418
(...skipping 20 matching lines...) Expand all
428 // outside the compositor's control (i.e. plugin layers), this information 439 // outside the compositor's control (i.e. plugin layers), this information
429 // is not available and the update rect will remain empty. 440 // is not available and the update rect will remain empty.
430 // Note this rect is in layer space (not content space). 441 // Note this rect is in layer space (not content space).
431 gfx::RectF update_rect_; 442 gfx::RectF update_rect_;
432 443
433 scoped_refptr<Layer> mask_layer_; 444 scoped_refptr<Layer> mask_layer_;
434 445
435 int layer_id_; 446 int layer_id_;
436 447
437 // When true, the layer is about to perform an update. Any commit requests 448 // When true, the layer is about to perform an update. Any commit requests
438 // will be handled implcitly after the update completes. 449 // will be handled implicitly after the update completes.
439 bool ignore_set_needs_commit_; 450 bool ignore_set_needs_commit_;
440 451
441 private: 452 private:
442 friend class base::RefCounted<Layer>; 453 friend class base::RefCounted<Layer>;
443 454
444 void SetParent(Layer* layer); 455 void SetParent(Layer* layer);
445 bool DescendantIsFixedToContainerLayer() const; 456 bool DescendantIsFixedToContainerLayer() const;
446 457
447 // Returns the index of the child or -1 if not found. 458 // Returns the index of the child or -1 if not found.
448 int IndexOfChild(const Layer* reference); 459 int IndexOfChild(const Layer* reference);
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 DrawProperties<Layer, RenderSurface> draw_properties_; 524 DrawProperties<Layer, RenderSurface> draw_properties_;
514 525
515 PaintProperties paint_properties_; 526 PaintProperties paint_properties_;
516 527
517 DISALLOW_COPY_AND_ASSIGN(Layer); 528 DISALLOW_COPY_AND_ASSIGN(Layer);
518 }; 529 };
519 530
520 } // namespace cc 531 } // namespace cc
521 532
522 #endif // CC_LAYERS_LAYER_H_ 533 #endif // CC_LAYERS_LAYER_H_
OLDNEW
« no previous file with comments | « no previous file | cc/layers/layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698