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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 } | 220 } |
221 | 221 |
222 bool WebLayerImpl::hasActiveAnimation() { return layer_->HasActiveAnimation(); } | 222 bool WebLayerImpl::hasActiveAnimation() { return layer_->HasActiveAnimation(); } |
223 | 223 |
224 void WebLayerImpl::setForceRenderSurface(bool force_render_surface) { | 224 void WebLayerImpl::setForceRenderSurface(bool force_render_surface) { |
225 layer_->SetForceRenderSurface(force_render_surface); | 225 layer_->SetForceRenderSurface(force_render_surface); |
226 } | 226 } |
227 | 227 |
228 void WebLayerImpl::setScrollPosition(WebKit::WebPoint position) { | 228 void WebLayerImpl::setScrollPosition(WebKit::WebPoint position) { |
229 layer_->SetScrollOffset(gfx::Point(position).OffsetFromOrigin()); | 229 layer_->SetScrollOffset(gfx::Point(position).OffsetFromOrigin()); |
230 // TODO(enne): Blink currently always updates scroll offset and layer position | |
231 // in tandem for frames in RenderLayerCompositor::frameViewDidScroll. | |
232 // So that this can be removed in Blink, temporarily do that work here. | |
233 // See: http://crbug.com/256381 | |
234 layer_->SetPosition(gfx::PointAtOffsetFromOrigin(-layer_->scroll_offset())); | |
235 } | 230 } |
236 | 231 |
237 WebKit::WebPoint WebLayerImpl::scrollPosition() const { | 232 WebKit::WebPoint WebLayerImpl::scrollPosition() const { |
238 return gfx::PointAtOffsetFromOrigin(layer_->scroll_offset()); | 233 return gfx::PointAtOffsetFromOrigin(layer_->scroll_offset()); |
239 } | 234 } |
240 | 235 |
241 void WebLayerImpl::setMaxScrollPosition(WebSize max_scroll_position) { | 236 void WebLayerImpl::setMaxScrollPosition(WebSize max_scroll_position) { |
242 layer_->SetMaxScrollOffset(max_scroll_position); | 237 layer_->SetMaxScrollOffset(max_scroll_position); |
243 } | 238 } |
244 | 239 |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 } else { | 358 } else { |
364 layer_->set_did_scroll_callback(base::Closure()); | 359 layer_->set_did_scroll_callback(base::Closure()); |
365 } | 360 } |
366 } | 361 } |
367 | 362 |
368 bool WebLayerImpl::isOrphan() const { return !layer_->layer_tree_host(); } | 363 bool WebLayerImpl::isOrphan() const { return !layer_->layer_tree_host(); } |
369 | 364 |
370 Layer* WebLayerImpl::layer() const { return layer_.get(); } | 365 Layer* WebLayerImpl::layer() const { return layer_.get(); } |
371 | 366 |
372 } // namespace webkit | 367 } // namespace webkit |
OLD | NEW |