| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "ui/gfx/compositor/layer.h" | 5 #include "ui/gfx/compositor/layer.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 643 } | 643 } |
| 644 | 644 |
| 645 const Transform& Layer::GetTransformForAnimation() const { | 645 const Transform& Layer::GetTransformForAnimation() const { |
| 646 return transform(); | 646 return transform(); |
| 647 } | 647 } |
| 648 | 648 |
| 649 float Layer::GetOpacityForAnimation() const { | 649 float Layer::GetOpacityForAnimation() const { |
| 650 return opacity(); | 650 return opacity(); |
| 651 } | 651 } |
| 652 | 652 |
| 653 void Layer::OnLayerAnimationEnded(LayerAnimationSequence* sequence) { | |
| 654 if (delegate_) | |
| 655 delegate_->OnLayerAnimationEnded(sequence); | |
| 656 } | |
| 657 | |
| 658 #if defined(USE_WEBKIT_COMPOSITOR) | 653 #if defined(USE_WEBKIT_COMPOSITOR) |
| 659 void Layer::CreateWebLayer() { | 654 void Layer::CreateWebLayer() { |
| 660 web_layer_ = WebKit::WebContentLayer::create(this, this); | 655 web_layer_ = WebKit::WebContentLayer::create(this, this); |
| 661 web_layer_.setAnchorPoint(WebKit::WebFloatPoint(0.f, 0.f)); | 656 web_layer_.setAnchorPoint(WebKit::WebFloatPoint(0.f, 0.f)); |
| 662 web_layer_.setOpaque(true); | 657 web_layer_.setOpaque(true); |
| 663 web_layer_is_accelerated_ = false; | 658 web_layer_is_accelerated_ = false; |
| 664 RecomputeDrawsContent(); | 659 RecomputeDrawsContent(); |
| 665 } | 660 } |
| 666 | 661 |
| 667 void Layer::RecomputeTransform() { | 662 void Layer::RecomputeTransform() { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 684 #else | 679 #else |
| 685 unsigned int texture_id = 0; | 680 unsigned int texture_id = 0; |
| 686 #endif | 681 #endif |
| 687 web_layer_.to<WebKit::WebExternalTextureLayer>().setTextureId( | 682 web_layer_.to<WebKit::WebExternalTextureLayer>().setTextureId( |
| 688 should_draw ? texture_id : 0); | 683 should_draw ? texture_id : 0); |
| 689 } | 684 } |
| 690 } | 685 } |
| 691 #endif | 686 #endif |
| 692 | 687 |
| 693 } // namespace ui | 688 } // namespace ui |
| OLD | NEW |