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