Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(226)

Side by Side Diff: sky/viewer/cc/web_layer_impl.cc

Issue 722063002: Remove moar composited scrolling from sky (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sky/viewer/cc/web_layer_impl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "sky/viewer/cc/web_layer_impl.h" 5 #include "sky/viewer/cc/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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 } 281 }
282 282
283 void WebLayerImpl::setScrollClipLayer(WebLayer* clip_layer) { 283 void WebLayerImpl::setScrollClipLayer(WebLayer* clip_layer) {
284 if (!clip_layer) { 284 if (!clip_layer) {
285 layer_->SetScrollClipLayerId(Layer::INVALID_ID); 285 layer_->SetScrollClipLayerId(Layer::INVALID_ID);
286 return; 286 return;
287 } 287 }
288 layer_->SetScrollClipLayerId(clip_layer->id()); 288 layer_->SetScrollClipLayerId(clip_layer->id());
289 } 289 }
290 290
291 bool WebLayerImpl::scrollable() const {
292 return layer_->scrollable();
293 }
294
295 void WebLayerImpl::setUserScrollable(bool horizontal, bool vertical) {
296 layer_->SetUserScrollable(horizontal, vertical);
297 }
298
299 bool WebLayerImpl::userScrollableHorizontal() const {
300 return layer_->user_scrollable_horizontal();
301 }
302
303 bool WebLayerImpl::userScrollableVertical() const {
304 return layer_->user_scrollable_vertical();
305 }
306
307 void WebLayerImpl::setHaveWheelEventHandlers(bool have_wheel_event_handlers) {
308 layer_->SetHaveWheelEventHandlers(have_wheel_event_handlers);
309 }
310
311 bool WebLayerImpl::haveWheelEventHandlers() const {
312 return layer_->have_wheel_event_handlers();
313 }
314
315 void WebLayerImpl::setHaveScrollEventHandlers(bool have_scroll_event_handlers) {
316 layer_->SetHaveScrollEventHandlers(have_scroll_event_handlers);
317 }
318
319 bool WebLayerImpl::haveScrollEventHandlers() const {
320 return layer_->have_scroll_event_handlers();
321 }
322
323 void WebLayerImpl::setShouldScrollOnMainThread(
324 bool should_scroll_on_main_thread) {
325 layer_->SetShouldScrollOnMainThread(should_scroll_on_main_thread);
326 }
327
328 bool WebLayerImpl::shouldScrollOnMainThread() const {
329 return layer_->should_scroll_on_main_thread();
330 }
331
332 void WebLayerImpl::setNonFastScrollableRegion(const WebVector<WebRect>& rects) {
333 cc::Region region;
334 for (size_t i = 0; i < rects.size(); ++i)
335 region.Union(rects[i]);
336 layer_->SetNonFastScrollableRegion(region);
337 }
338
339 void WebLayerImpl::setScrollClient(blink::WebLayerScrollClient* scroll_client) { 291 void WebLayerImpl::setScrollClient(blink::WebLayerScrollClient* scroll_client) {
340 if (scroll_client) { 292 if (scroll_client) {
341 layer_->set_did_scroll_callback( 293 layer_->set_did_scroll_callback(
342 base::Bind(&blink::WebLayerScrollClient::didScroll, 294 base::Bind(&blink::WebLayerScrollClient::didScroll,
343 base::Unretained(scroll_client))); 295 base::Unretained(scroll_client)));
344 } else { 296 } else {
345 layer_->set_did_scroll_callback(base::Closure()); 297 layer_->set_did_scroll_callback(base::Closure());
346 } 298 }
347 } 299 }
348 300
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 if (parent) 349 if (parent)
398 clip_parent = static_cast<WebLayerImpl*>(parent)->layer(); 350 clip_parent = static_cast<WebLayerImpl*>(parent)->layer();
399 layer_->SetClipParent(clip_parent); 351 layer_->SetClipParent(clip_parent);
400 } 352 }
401 353
402 Layer* WebLayerImpl::layer() const { 354 Layer* WebLayerImpl::layer() const {
403 return layer_.get(); 355 return layer_.get();
404 } 356 }
405 357
406 } // namespace sky_viewer_cc 358 } // namespace sky_viewer_cc
OLDNEW
« no previous file with comments | « sky/viewer/cc/web_layer_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698