| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "webkit/renderer/compositor_bindings/web_layer_impl.h" | 5 #include "webkit/renderer/compositor_bindings/web_layer_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "cc/animation/animation.h" | 9 #include "cc/animation/animation.h" |
| 10 #include "cc/base/region.h" | 10 #include "cc/base/region.h" |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 static_cast<const WebFilterOperationsImpl&>(filters); | 171 static_cast<const WebFilterOperationsImpl&>(filters); |
| 172 layer_->SetFilters(filters_impl.AsFilterOperations()); | 172 layer_->SetFilters(filters_impl.AsFilterOperations()); |
| 173 } | 173 } |
| 174 | 174 |
| 175 void WebLayerImpl::setBackgroundFilters(const WebFilterOperations& filters) { | 175 void WebLayerImpl::setBackgroundFilters(const WebFilterOperations& filters) { |
| 176 const WebFilterOperationsImpl& filters_impl = | 176 const WebFilterOperationsImpl& filters_impl = |
| 177 static_cast<const WebFilterOperationsImpl&>(filters); | 177 static_cast<const WebFilterOperationsImpl&>(filters); |
| 178 layer_->SetBackgroundFilters(filters_impl.AsFilterOperations()); | 178 layer_->SetBackgroundFilters(filters_impl.AsFilterOperations()); |
| 179 } | 179 } |
| 180 | 180 |
| 181 // TODO(ajuma): Remove this once the Blink CL that stops calling this lands. |
| 181 void WebLayerImpl::setFilter(SkImageFilter* filter) { | 182 void WebLayerImpl::setFilter(SkImageFilter* filter) { |
| 182 layer_->SetFilter(skia::SharePtr(filter)); | 183 cc::FilterOperations filters; |
| 184 if (filter) { |
| 185 filters.Append( |
| 186 cc::FilterOperation::CreateReferenceFilter(skia::SharePtr(filter))); |
| 187 } |
| 188 layer_->SetFilters(filters); |
| 183 } | 189 } |
| 184 | 190 |
| 185 void WebLayerImpl::setCompositingReasons( | 191 void WebLayerImpl::setCompositingReasons( |
| 186 WebKit::WebCompositingReasons reasons) { | 192 WebKit::WebCompositingReasons reasons) { |
| 187 layer_->SetCompositingReasons(reasons); | 193 layer_->SetCompositingReasons(reasons); |
| 188 } | 194 } |
| 189 | 195 |
| 190 void WebLayerImpl::setAnimationDelegate( | 196 void WebLayerImpl::setAnimationDelegate( |
| 191 WebKit::WebAnimationDelegate* delegate) { | 197 WebKit::WebAnimationDelegate* delegate) { |
| 192 animation_delegate_adapter_.reset( | 198 animation_delegate_adapter_.reset( |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 void WebLayerImpl::setClipParent(WebKit::WebLayer* parent) { | 395 void WebLayerImpl::setClipParent(WebKit::WebLayer* parent) { |
| 390 cc::Layer* clip_parent = NULL; | 396 cc::Layer* clip_parent = NULL; |
| 391 if (parent) | 397 if (parent) |
| 392 clip_parent = static_cast<WebLayerImpl*>(parent)->layer(); | 398 clip_parent = static_cast<WebLayerImpl*>(parent)->layer(); |
| 393 layer_->SetClipParent(clip_parent); | 399 layer_->SetClipParent(clip_parent); |
| 394 } | 400 } |
| 395 | 401 |
| 396 Layer* WebLayerImpl::layer() const { return layer_.get(); } | 402 Layer* WebLayerImpl::layer() const { return layer_.get(); } |
| 397 | 403 |
| 398 } // namespace webkit | 404 } // namespace webkit |
| OLD | NEW |