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

Side by Side Diff: ui/compositor/layer.h

Issue 2108043002: Clear ui::Layer damaged_region_ after commit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 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
« no previous file with comments | « no previous file | ui/compositor/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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 UI_COMPOSITOR_LAYER_H_ 5 #ifndef UI_COMPOSITOR_LAYER_H_
6 #define UI_COMPOSITOR_LAYER_H_ 6 #define UI_COMPOSITOR_LAYER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 bool SchedulePaint(const gfx::Rect& invalid_rect); 321 bool SchedulePaint(const gfx::Rect& invalid_rect);
322 322
323 // Schedules a redraw of the layer tree at the compositor. 323 // Schedules a redraw of the layer tree at the compositor.
324 // Note that this _does not_ invalidate any region of this layer; use 324 // Note that this _does not_ invalidate any region of this layer; use
325 // SchedulePaint() for that. 325 // SchedulePaint() for that.
326 void ScheduleDraw(); 326 void ScheduleDraw();
327 327
328 // Uses damaged rectangles recorded in |damaged_region_| to invalidate the 328 // Uses damaged rectangles recorded in |damaged_region_| to invalidate the
329 // |cc_layer_|. 329 // |cc_layer_|.
330 void SendDamagedRects(); 330 void SendDamagedRects();
331 void ClearDamagedRects();
332 331
333 const cc::Region& damaged_region() const { return damaged_region_; } 332 const cc::Region& damaged_region() const { return damaged_region_; }
334 333
335 void CompleteAllAnimations(); 334 void CompleteAllAnimations();
336 335
337 // Suppresses painting the content by disconnecting |delegate_|. 336 // Suppresses painting the content by disconnecting |delegate_|.
338 void SuppressPaint(); 337 void SuppressPaint();
339 338
340 // Notifies the layer that the device scale factor has changed. 339 // Notifies the layer that the device scale factor has changed.
341 void OnDeviceScaleFactorChanged(float device_scale_factor); 340 void OnDeviceScaleFactorChanged(float device_scale_factor);
(...skipping 25 matching lines...) Expand all
367 // LayerClient 366 // LayerClient
368 std::unique_ptr<base::trace_event::ConvertableToTraceFormat> TakeDebugInfo( 367 std::unique_ptr<base::trace_event::ConvertableToTraceFormat> TakeDebugInfo(
369 cc::Layer* layer) override; 368 cc::Layer* layer) override;
370 369
371 // Whether this layer has animations waiting to get sent to its cc::Layer. 370 // Whether this layer has animations waiting to get sent to its cc::Layer.
372 bool HasPendingThreadedAnimationsForTesting() const; 371 bool HasPendingThreadedAnimationsForTesting() const;
373 372
374 // Triggers a call to SwitchToLayer. 373 // Triggers a call to SwitchToLayer.
375 void SwitchCCLayerForTest(); 374 void SwitchCCLayerForTest();
376 375
376 const cc::Region& damaged_region_for_testing() const {
377 return damaged_region_;
378 }
379
377 private: 380 private:
378 friend class LayerOwner; 381 friend class LayerOwner;
379 382
380 void CollectAnimators(std::vector<scoped_refptr<LayerAnimator> >* animators); 383 void CollectAnimators(std::vector<scoped_refptr<LayerAnimator> >* animators);
381 384
382 // Stacks |child| above or below |other|. Helper method for StackAbove() and 385 // Stacks |child| above or below |other|. Helper method for StackAbove() and
383 // StackBelow(). 386 // StackBelow().
384 void StackRelativeTo(Layer* child, Layer* other, bool above); 387 void StackRelativeTo(Layer* child, Layer* other, bool above);
385 388
386 bool ConvertPointForAncestor(const Layer* ancestor, gfx::Point* point) const; 389 bool ConvertPointForAncestor(const Layer* ancestor, gfx::Point* point) const;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 440
438 gfx::Rect bounds_; 441 gfx::Rect bounds_;
439 gfx::Vector2dF subpixel_position_offset_; 442 gfx::Vector2dF subpixel_position_offset_;
440 443
441 // Visibility of this layer. See SetVisible/IsDrawn for more details. 444 // Visibility of this layer. See SetVisible/IsDrawn for more details.
442 bool visible_; 445 bool visible_;
443 446
444 bool fills_bounds_opaquely_; 447 bool fills_bounds_opaquely_;
445 bool fills_bounds_completely_; 448 bool fills_bounds_completely_;
446 449
450 // Union of damaged rects, in layer space, that SetNeedsDisplayRect should
451 // be called on.
452 cc::Region damaged_region_;
453
447 // Union of damaged rects, in layer space, to be used when compositor is ready 454 // Union of damaged rects, in layer space, to be used when compositor is ready
448 // to paint the content. 455 // to paint the content.
449 cc::Region damaged_region_; 456 cc::Region paint_region_;
450 457
451 int background_blur_radius_; 458 int background_blur_radius_;
452 459
453 // Several variables which will change the visible representation of 460 // Several variables which will change the visible representation of
454 // the layer. 461 // the layer.
455 float layer_saturation_; 462 float layer_saturation_;
456 float layer_brightness_; 463 float layer_brightness_;
457 float layer_grayscale_; 464 float layer_grayscale_;
458 bool layer_inverted_; 465 bool layer_inverted_;
459 466
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 // The size of the frame or texture in DIP, set when SetShowDelegatedContent 516 // The size of the frame or texture in DIP, set when SetShowDelegatedContent
510 // or SetTextureMailbox was called. 517 // or SetTextureMailbox was called.
511 gfx::Size frame_size_in_dip_; 518 gfx::Size frame_size_in_dip_;
512 519
513 DISALLOW_COPY_AND_ASSIGN(Layer); 520 DISALLOW_COPY_AND_ASSIGN(Layer);
514 }; 521 };
515 522
516 } // namespace ui 523 } // namespace ui
517 524
518 #endif // UI_COMPOSITOR_LAYER_H_ 525 #endif // UI_COMPOSITOR_LAYER_H_
OLDNEW
« no previous file with comments | « no previous file | ui/compositor/layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698