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

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: Another test Created 7 years, 5 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 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 return num_dependents_need_push_properties_ > 0; 386 return num_dependents_need_push_properties_ > 0;
387 } 387 }
388 388
389 protected: 389 protected:
390 friend class LayerImpl; 390 friend class LayerImpl;
391 friend class TreeSynchronizer; 391 friend class TreeSynchronizer;
392 virtual ~Layer(); 392 virtual ~Layer();
393 393
394 Layer(); 394 Layer();
395 395
396 // These SetNeeds functions are in order of severity of update:
397 //
398 // Called when this layer has been modified in some way, but isn't sure
399 // that it needs a commit yet. It needs CalcDrawProperties and UpdateLayers
400 // before it knows whether or not a commit is required.
401 void SetNeedsUpdate();
402 // Called when a property has been modified in a way that the layer
403 // knows immediately that a commit is required. This implies SetNeedsUpdate
404 // as well as SetNeedsPushProperties to push that property.
396 void SetNeedsCommit(); 405 void SetNeedsCommit();
406 // Called when there's been a change in layer structure. Implies both
407 // SetNeedsUpdate and SetNeedsCommit, but not SetNeedsPushProperties.
397 void SetNeedsFullTreeSync(); 408 void SetNeedsFullTreeSync();
398 bool IsPropertyChangeAllowed() const; 409 bool IsPropertyChangeAllowed() const;
399 410
400 void SetNeedsPushProperties(); 411 void SetNeedsPushProperties();
401 void AddDependentNeedsPushProperties(); 412 void AddDependentNeedsPushProperties();
402 void RemoveDependentNeedsPushProperties(); 413 void RemoveDependentNeedsPushProperties();
403 bool parent_should_know_need_push_properties() const { 414 bool parent_should_know_need_push_properties() const {
404 return needs_push_properties() || descendant_needs_push_properties(); 415 return needs_push_properties() || descendant_needs_push_properties();
405 } 416 }
406 417
(...skipping 20 matching lines...) Expand all
427 // outside the compositor's control (i.e. plugin layers), this information 438 // outside the compositor's control (i.e. plugin layers), this information
428 // is not available and the update rect will remain empty. 439 // is not available and the update rect will remain empty.
429 // Note this rect is in layer space (not content space). 440 // Note this rect is in layer space (not content space).
430 gfx::RectF update_rect_; 441 gfx::RectF update_rect_;
431 442
432 scoped_refptr<Layer> mask_layer_; 443 scoped_refptr<Layer> mask_layer_;
433 444
434 int layer_id_; 445 int layer_id_;
435 446
436 // When true, the layer is about to perform an update. Any commit requests 447 // When true, the layer is about to perform an update. Any commit requests
437 // will be handled implcitly after the update completes. 448 // will be handled implicitly after the update completes.
438 bool ignore_set_needs_commit_; 449 bool ignore_set_needs_commit_;
439 450
440 private: 451 private:
441 friend class base::RefCounted<Layer>; 452 friend class base::RefCounted<Layer>;
442 453
443 void SetParent(Layer* layer); 454 void SetParent(Layer* layer);
444 bool HasAncestor(const Layer* ancestor) const; 455 bool HasAncestor(const Layer* ancestor) const;
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.
(...skipping 65 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