| 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 <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/message_loop/message_loop.h" | 14 #include "base/message_loop/message_loop.h" |
| 15 #include "cc/animation/animation_events.h" | 15 #include "cc/animation/animation_events.h" |
| 16 #include "cc/animation/layer_animation_event_observer.h" | 16 #include "cc/animation/layer_animation_event_observer.h" |
| 17 #include "cc/base/region.h" | |
| 18 #include "cc/base/scoped_ptr_vector.h" | 17 #include "cc/base/scoped_ptr_vector.h" |
| 19 #include "cc/layers/content_layer_client.h" | 18 #include "cc/layers/content_layer_client.h" |
| 20 #include "cc/layers/layer_client.h" | 19 #include "cc/layers/layer_client.h" |
| 21 #include "cc/layers/surface_layer.h" | 20 #include "cc/layers/surface_layer.h" |
| 22 #include "cc/layers/texture_layer_client.h" | 21 #include "cc/layers/texture_layer_client.h" |
| 23 #include "cc/resources/texture_mailbox.h" | 22 #include "cc/resources/texture_mailbox.h" |
| 24 #include "cc/surfaces/surface_id.h" | 23 #include "cc/surfaces/surface_id.h" |
| 25 #include "third_party/skia/include/core/SkColor.h" | 24 #include "third_party/skia/include/core/SkColor.h" |
| 26 #include "third_party/skia/include/core/SkRegion.h" | 25 #include "third_party/skia/include/core/SkRegion.h" |
| 27 #include "ui/compositor/compositor.h" | 26 #include "ui/compositor/compositor.h" |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 bool SchedulePaint(const gfx::Rect& invalid_rect); | 312 bool SchedulePaint(const gfx::Rect& invalid_rect); |
| 314 | 313 |
| 315 // Schedules a redraw of the layer tree at the compositor. | 314 // Schedules a redraw of the layer tree at the compositor. |
| 316 // Note that this _does not_ invalidate any region of this layer; use | 315 // Note that this _does not_ invalidate any region of this layer; use |
| 317 // SchedulePaint() for that. | 316 // SchedulePaint() for that. |
| 318 void ScheduleDraw(); | 317 void ScheduleDraw(); |
| 319 | 318 |
| 320 // Uses damaged rectangles recorded in |damaged_region_| to invalidate the | 319 // Uses damaged rectangles recorded in |damaged_region_| to invalidate the |
| 321 // |cc_layer_|. | 320 // |cc_layer_|. |
| 322 void SendDamagedRects(); | 321 void SendDamagedRects(); |
| 323 void ClearDamagedRects(); | |
| 324 | 322 |
| 325 const cc::Region& damaged_region() const { return damaged_region_; } | 323 const SkRegion& damaged_region() const { return damaged_region_; } |
| 326 | 324 |
| 327 void CompleteAllAnimations(); | 325 void CompleteAllAnimations(); |
| 328 | 326 |
| 329 // Suppresses painting the content by disconnecting |delegate_|. | 327 // Suppresses painting the content by disconnecting |delegate_|. |
| 330 void SuppressPaint(); | 328 void SuppressPaint(); |
| 331 | 329 |
| 332 // Notifies the layer that the device scale factor has changed. | 330 // Notifies the layer that the device scale factor has changed. |
| 333 void OnDeviceScaleFactorChanged(float device_scale_factor); | 331 void OnDeviceScaleFactorChanged(float device_scale_factor); |
| 334 | 332 |
| 335 // Notifies the layer that one of its children has received a new | 333 // Notifies the layer that one of its children has received a new |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 gfx::Vector2dF subpixel_position_offset_; | 452 gfx::Vector2dF subpixel_position_offset_; |
| 455 | 453 |
| 456 // Visibility of this layer. See SetVisible/IsDrawn for more details. | 454 // Visibility of this layer. See SetVisible/IsDrawn for more details. |
| 457 bool visible_; | 455 bool visible_; |
| 458 | 456 |
| 459 bool force_render_surface_; | 457 bool force_render_surface_; |
| 460 | 458 |
| 461 bool fills_bounds_opaquely_; | 459 bool fills_bounds_opaquely_; |
| 462 bool fills_bounds_completely_; | 460 bool fills_bounds_completely_; |
| 463 | 461 |
| 464 // Union of damaged rects, in layer space, to be used when compositor is ready | 462 // Union of damaged rects, in pixel coordinates, to be used when |
| 465 // to paint the content. | 463 // compositor is ready to paint the content. |
| 466 cc::Region damaged_region_; | 464 SkRegion damaged_region_; |
| 467 | 465 |
| 468 int background_blur_radius_; | 466 int background_blur_radius_; |
| 469 | 467 |
| 470 // Several variables which will change the visible representation of | 468 // Several variables which will change the visible representation of |
| 471 // the layer. | 469 // the layer. |
| 472 float layer_saturation_; | 470 float layer_saturation_; |
| 473 float layer_brightness_; | 471 float layer_brightness_; |
| 474 float layer_grayscale_; | 472 float layer_grayscale_; |
| 475 bool layer_inverted_; | 473 bool layer_inverted_; |
| 476 | 474 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 // The size of the frame or texture in DIP, set when SetShowDelegatedContent | 529 // The size of the frame or texture in DIP, set when SetShowDelegatedContent |
| 532 // or SetTextureMailbox was called. | 530 // or SetTextureMailbox was called. |
| 533 gfx::Size frame_size_in_dip_; | 531 gfx::Size frame_size_in_dip_; |
| 534 | 532 |
| 535 DISALLOW_COPY_AND_ASSIGN(Layer); | 533 DISALLOW_COPY_AND_ASSIGN(Layer); |
| 536 }; | 534 }; |
| 537 | 535 |
| 538 } // namespace ui | 536 } // namespace ui |
| 539 | 537 |
| 540 #endif // UI_COMPOSITOR_LAYER_H_ | 538 #endif // UI_COMPOSITOR_LAYER_H_ |
| OLD | NEW |