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