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/debug/trace_event_impl.h" | 8 #include "base/debug/trace_event_impl.h" |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 | 251 |
252 blink::WebPoint WebLayerImpl::scrollPosition() const { | 252 blink::WebPoint WebLayerImpl::scrollPosition() const { |
253 return gfx::PointAtOffsetFromOrigin(layer_->scroll_offset()); | 253 return gfx::PointAtOffsetFromOrigin(layer_->scroll_offset()); |
254 } | 254 } |
255 | 255 |
256 WebSize WebLayerImpl::maxScrollPosition() const { | 256 WebSize WebLayerImpl::maxScrollPosition() const { |
257 return layer_->MaxScrollOffset(); | 257 return layer_->MaxScrollOffset(); |
258 } | 258 } |
259 | 259 |
260 void WebLayerImpl::setScrollClipLayer(WebLayer* clip_layer) { | 260 void WebLayerImpl::setScrollClipLayer(WebLayer* clip_layer) { |
261 cc::Layer* cc_clip_layer = | 261 if (!clip_layer) { |
262 clip_layer ? static_cast<WebLayerImpl*>(clip_layer)->layer() : 0; | 262 layer_->SetScrollClipLayerId(Layer::INVALID_ID); |
263 layer_->SetScrollClipLayerId(cc_clip_layer->id()); | 263 return; |
| 264 } |
| 265 layer_->SetScrollClipLayerId(clip_layer->id()); |
264 } | 266 } |
265 | 267 |
266 bool WebLayerImpl::scrollable() const { return layer_->scrollable(); } | 268 bool WebLayerImpl::scrollable() const { return layer_->scrollable(); } |
267 | 269 |
268 void WebLayerImpl::setUserScrollable(bool horizontal, bool vertical) { | 270 void WebLayerImpl::setUserScrollable(bool horizontal, bool vertical) { |
269 layer_->SetUserScrollable(horizontal, vertical); | 271 layer_->SetUserScrollable(horizontal, vertical); |
270 } | 272 } |
271 | 273 |
272 bool WebLayerImpl::userScrollableHorizontal() const { | 274 bool WebLayerImpl::userScrollableHorizontal() const { |
273 return layer_->user_scrollable_horizontal(); | 275 return layer_->user_scrollable_horizontal(); |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 void WebLayerImpl::setClipParent(blink::WebLayer* parent) { | 438 void WebLayerImpl::setClipParent(blink::WebLayer* parent) { |
437 cc::Layer* clip_parent = NULL; | 439 cc::Layer* clip_parent = NULL; |
438 if (parent) | 440 if (parent) |
439 clip_parent = static_cast<WebLayerImpl*>(parent)->layer(); | 441 clip_parent = static_cast<WebLayerImpl*>(parent)->layer(); |
440 layer_->SetClipParent(clip_parent); | 442 layer_->SetClipParent(clip_parent); |
441 } | 443 } |
442 | 444 |
443 Layer* WebLayerImpl::layer() const { return layer_.get(); } | 445 Layer* WebLayerImpl::layer() const { return layer_.get(); } |
444 | 446 |
445 } // namespace webkit | 447 } // namespace webkit |
OLD | NEW |