OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "cc/blink/web_layer_impl.h" | 5 #include "cc/blink/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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 } | 261 } |
262 | 262 |
263 bool WebLayerImpl::hasActiveAnimation() { | 263 bool WebLayerImpl::hasActiveAnimation() { |
264 return layer_->HasActiveAnimation(); | 264 return layer_->HasActiveAnimation(); |
265 } | 265 } |
266 | 266 |
267 void WebLayerImpl::setForceRenderSurface(bool force_render_surface) { | 267 void WebLayerImpl::setForceRenderSurface(bool force_render_surface) { |
268 layer_->SetForceRenderSurface(force_render_surface); | 268 layer_->SetForceRenderSurface(force_render_surface); |
269 } | 269 } |
270 | 270 |
271 void WebLayerImpl::setScrollPosition(blink::WebPoint position) { | |
272 layer_->SetScrollOffset(gfx::ScrollOffset(position.x, position.y)); | |
273 } | |
274 | |
275 blink::WebPoint WebLayerImpl::scrollPosition() const { | |
276 return gfx::PointAtOffsetFromOrigin( | |
277 gfx::ScrollOffsetToFlooredVector2d(layer_->scroll_offset())); | |
278 } | |
279 | |
280 void WebLayerImpl::setScrollPositionDouble(blink::WebDoublePoint position) { | 271 void WebLayerImpl::setScrollPositionDouble(blink::WebDoublePoint position) { |
281 layer_->SetScrollOffset(gfx::ScrollOffset(position.x, position.y)); | 272 layer_->SetScrollOffset(gfx::ScrollOffset(position.x, position.y)); |
282 } | 273 } |
283 | 274 |
284 blink::WebDoublePoint WebLayerImpl::scrollPositionDouble() const { | 275 blink::WebDoublePoint WebLayerImpl::scrollPositionDouble() const { |
285 return blink::WebDoublePoint(layer_->scroll_offset().x(), | 276 return blink::WebDoublePoint(layer_->scroll_offset().x(), |
286 layer_->scroll_offset().y()); | 277 layer_->scroll_offset().y()); |
287 } | 278 } |
288 | 279 |
289 void WebLayerImpl::setScrollClipLayer(WebLayer* clip_layer) { | 280 void WebLayerImpl::setScrollClipLayer(WebLayer* clip_layer) { |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 if (parent) | 472 if (parent) |
482 clip_parent = static_cast<WebLayerImpl*>(parent)->layer(); | 473 clip_parent = static_cast<WebLayerImpl*>(parent)->layer(); |
483 layer_->SetClipParent(clip_parent); | 474 layer_->SetClipParent(clip_parent); |
484 } | 475 } |
485 | 476 |
486 Layer* WebLayerImpl::layer() const { | 477 Layer* WebLayerImpl::layer() const { |
487 return layer_.get(); | 478 return layer_.get(); |
488 } | 479 } |
489 | 480 |
490 } // namespace cc_blink | 481 } // namespace cc_blink |
OLD | NEW |