OLD | NEW |
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 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 bool SchedulePaint(const gfx::Rect& invalid_rect); | 327 bool SchedulePaint(const gfx::Rect& invalid_rect); |
328 | 328 |
329 // Schedules a redraw of the layer tree at the compositor. | 329 // Schedules a redraw of the layer tree at the compositor. |
330 // Note that this _does not_ invalidate any region of this layer; use | 330 // Note that this _does not_ invalidate any region of this layer; use |
331 // SchedulePaint() for that. | 331 // SchedulePaint() for that. |
332 void ScheduleDraw(); | 332 void ScheduleDraw(); |
333 | 333 |
334 // Uses damaged rectangles recorded in |damaged_region_| to invalidate the | 334 // Uses damaged rectangles recorded in |damaged_region_| to invalidate the |
335 // |cc_layer_|. | 335 // |cc_layer_|. |
336 void SendDamagedRects(); | 336 void SendDamagedRects(); |
| 337 void ClearDamagedRects(); |
337 | 338 |
338 const cc::Region& damaged_region() const { return damaged_region_; } | 339 const cc::Region& damaged_region() const { return damaged_region_; } |
339 | 340 |
340 void CompleteAllAnimations(); | 341 void CompleteAllAnimations(); |
341 | 342 |
342 // Suppresses painting the content by disconnecting |delegate_|. | 343 // Suppresses painting the content by disconnecting |delegate_|. |
343 void SuppressPaint(); | 344 void SuppressPaint(); |
344 | 345 |
345 // Notifies the layer that the device scale factor has changed. | 346 // Notifies the layer that the device scale factor has changed. |
346 void OnDeviceScaleFactorChanged(float device_scale_factor); | 347 void OnDeviceScaleFactorChanged(float device_scale_factor); |
(...skipping 25 matching lines...) Expand all Loading... |
372 // LayerClient | 373 // LayerClient |
373 std::unique_ptr<base::trace_event::ConvertableToTraceFormat> TakeDebugInfo( | 374 std::unique_ptr<base::trace_event::ConvertableToTraceFormat> TakeDebugInfo( |
374 cc::Layer* layer) override; | 375 cc::Layer* layer) override; |
375 | 376 |
376 // Whether this layer has animations waiting to get sent to its cc::Layer. | 377 // Whether this layer has animations waiting to get sent to its cc::Layer. |
377 bool HasPendingThreadedAnimationsForTesting() const; | 378 bool HasPendingThreadedAnimationsForTesting() const; |
378 | 379 |
379 // Triggers a call to SwitchToLayer. | 380 // Triggers a call to SwitchToLayer. |
380 void SwitchCCLayerForTest(); | 381 void SwitchCCLayerForTest(); |
381 | 382 |
382 const cc::Region& damaged_region_for_testing() const { | |
383 return damaged_region_; | |
384 } | |
385 | |
386 private: | 383 private: |
387 friend class LayerOwner; | 384 friend class LayerOwner; |
388 | 385 |
389 void CollectAnimators(std::vector<scoped_refptr<LayerAnimator> >* animators); | 386 void CollectAnimators(std::vector<scoped_refptr<LayerAnimator> >* animators); |
390 | 387 |
391 // Stacks |child| above or below |other|. Helper method for StackAbove() and | 388 // Stacks |child| above or below |other|. Helper method for StackAbove() and |
392 // StackBelow(). | 389 // StackBelow(). |
393 void StackRelativeTo(Layer* child, Layer* other, bool above); | 390 void StackRelativeTo(Layer* child, Layer* other, bool above); |
394 | 391 |
395 bool ConvertPointForAncestor(const Layer* ancestor, gfx::Point* point) const; | 392 bool ConvertPointForAncestor(const Layer* ancestor, gfx::Point* point) const; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 | 443 |
447 gfx::Rect bounds_; | 444 gfx::Rect bounds_; |
448 gfx::Vector2dF subpixel_position_offset_; | 445 gfx::Vector2dF subpixel_position_offset_; |
449 | 446 |
450 // Visibility of this layer. See SetVisible/IsDrawn for more details. | 447 // Visibility of this layer. See SetVisible/IsDrawn for more details. |
451 bool visible_; | 448 bool visible_; |
452 | 449 |
453 bool fills_bounds_opaquely_; | 450 bool fills_bounds_opaquely_; |
454 bool fills_bounds_completely_; | 451 bool fills_bounds_completely_; |
455 | 452 |
456 // Union of damaged rects, in layer space, that SetNeedsDisplayRect should | |
457 // be called on. | |
458 cc::Region damaged_region_; | |
459 | |
460 // Union of damaged rects, in layer space, to be used when compositor is ready | 453 // Union of damaged rects, in layer space, to be used when compositor is ready |
461 // to paint the content. | 454 // to paint the content. |
462 cc::Region paint_region_; | 455 cc::Region damaged_region_; |
463 | 456 |
464 int background_blur_radius_; | 457 int background_blur_radius_; |
465 | 458 |
466 // Several variables which will change the visible representation of | 459 // Several variables which will change the visible representation of |
467 // the layer. | 460 // the layer. |
468 float layer_saturation_; | 461 float layer_saturation_; |
469 float layer_brightness_; | 462 float layer_brightness_; |
470 float layer_grayscale_; | 463 float layer_grayscale_; |
471 bool layer_inverted_; | 464 bool layer_inverted_; |
472 | 465 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
529 // The texture scale. | 522 // The texture scale. |
530 float texture_x_scale_; | 523 float texture_x_scale_; |
531 float texture_y_scale_; | 524 float texture_y_scale_; |
532 | 525 |
533 DISALLOW_COPY_AND_ASSIGN(Layer); | 526 DISALLOW_COPY_AND_ASSIGN(Layer); |
534 }; | 527 }; |
535 | 528 |
536 } // namespace ui | 529 } // namespace ui |
537 | 530 |
538 #endif // UI_COMPOSITOR_LAYER_H_ | 531 #endif // UI_COMPOSITOR_LAYER_H_ |
OLD | NEW |