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/scoped_ptr_vector.h" | 17 #include "cc/base/scoped_ptr_vector.h" |
18 #include "cc/layers/content_layer_client.h" | 18 #include "cc/layers/content_layer_client.h" |
19 #include "cc/layers/layer_client.h" | 19 #include "cc/layers/layer_client.h" |
20 #include "cc/layers/picture_layer.h" | |
20 #include "cc/layers/texture_layer_client.h" | 21 #include "cc/layers/texture_layer_client.h" |
21 #include "cc/resources/texture_mailbox.h" | 22 #include "cc/resources/texture_mailbox.h" |
22 #include "third_party/skia/include/core/SkColor.h" | 23 #include "third_party/skia/include/core/SkColor.h" |
23 #include "third_party/skia/include/core/SkRegion.h" | 24 #include "third_party/skia/include/core/SkRegion.h" |
24 #include "ui/compositor/compositor.h" | 25 #include "ui/compositor/compositor.h" |
25 #include "ui/compositor/layer_animation_delegate.h" | 26 #include "ui/compositor/layer_animation_delegate.h" |
26 #include "ui/compositor/layer_delegate.h" | 27 #include "ui/compositor/layer_delegate.h" |
27 #include "ui/compositor/layer_type.h" | 28 #include "ui/compositor/layer_type.h" |
28 #include "ui/gfx/rect.h" | 29 #include "ui/gfx/rect.h" |
29 #include "ui/gfx/transform.h" | 30 #include "ui/gfx/transform.h" |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
450 LayerDelegate* delegate_; | 451 LayerDelegate* delegate_; |
451 | 452 |
452 scoped_refptr<LayerAnimator> animator_; | 453 scoped_refptr<LayerAnimator> animator_; |
453 | 454 |
454 // Animations that are passed to AddThreadedAnimation before this layer is | 455 // Animations that are passed to AddThreadedAnimation before this layer is |
455 // added to a tree. | 456 // added to a tree. |
456 cc::ScopedPtrVector<cc::Animation> pending_threaded_animations_; | 457 cc::ScopedPtrVector<cc::Animation> pending_threaded_animations_; |
457 | 458 |
458 // Ownership of the layer is held through one of the strongly typed layer | 459 // Ownership of the layer is held through one of the strongly typed layer |
459 // pointers, depending on which sort of layer this is. | 460 // pointers, depending on which sort of layer this is. |
460 scoped_refptr<cc::ContentLayer> content_layer_; | 461 scoped_refptr<cc::Layer> content_layer_; |
reveman
2014/03/07 19:35:13
Let's move this and layer.cc changes into a separa
| |
461 scoped_refptr<cc::TextureLayer> texture_layer_; | 462 scoped_refptr<cc::TextureLayer> texture_layer_; |
462 scoped_refptr<cc::SolidColorLayer> solid_color_layer_; | 463 scoped_refptr<cc::SolidColorLayer> solid_color_layer_; |
463 scoped_refptr<cc::DelegatedRendererLayer> delegated_renderer_layer_; | 464 scoped_refptr<cc::DelegatedRendererLayer> delegated_renderer_layer_; |
464 cc::Layer* cc_layer_; | 465 cc::Layer* cc_layer_; |
465 | 466 |
466 // If true, the layer scales the canvas and the texture with the device scale | 467 // If true, the layer scales the canvas and the texture with the device scale |
467 // factor as apporpriate. When true, the texture size is in DIP. | 468 // factor as apporpriate. When true, the texture size is in DIP. |
468 bool scale_content_; | 469 bool scale_content_; |
469 | 470 |
470 // A cached copy of |Compositor::device_scale_factor()|. | 471 // A cached copy of |Compositor::device_scale_factor()|. |
471 float device_scale_factor_; | 472 float device_scale_factor_; |
472 | 473 |
473 // A cached copy of the TextureMailbox given texture_layer_. | 474 // A cached copy of the TextureMailbox given texture_layer_. |
474 cc::TextureMailbox mailbox_; | 475 cc::TextureMailbox mailbox_; |
475 | 476 |
476 // Device scale factor in which mailbox_ was rendered in. | 477 // Device scale factor in which mailbox_ was rendered in. |
477 float mailbox_scale_factor_; | 478 float mailbox_scale_factor_; |
478 | 479 |
479 // The size of the delegated frame in DIP, set when SetShowDelegatedContent | 480 // The size of the delegated frame in DIP, set when SetShowDelegatedContent |
480 // was called. | 481 // was called. |
481 gfx::Size delegated_frame_size_in_dip_; | 482 gfx::Size delegated_frame_size_in_dip_; |
482 | 483 |
483 DISALLOW_COPY_AND_ASSIGN(Layer); | 484 DISALLOW_COPY_AND_ASSIGN(Layer); |
484 }; | 485 }; |
485 | 486 |
486 } // namespace ui | 487 } // namespace ui |
487 | 488 |
488 #endif // UI_COMPOSITOR_LAYER_H_ | 489 #endif // UI_COMPOSITOR_LAYER_H_ |
OLD | NEW |