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

Side by Side Diff: third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp

Issue 2591863003: Use nine-patch resource for drawing Aura overlay scrollbar thumb. (Closed)
Patch Set: Move CheckGeometryLimitations back to where it used to be (AppendQuads) Created 3 years, 9 months 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 } 338 }
339 339
340 static std::unique_ptr<WebScrollbarLayer> createScrollbarLayer( 340 static std::unique_ptr<WebScrollbarLayer> createScrollbarLayer(
341 Scrollbar& scrollbar, 341 Scrollbar& scrollbar,
342 float deviceScaleFactor) { 342 float deviceScaleFactor) {
343 ScrollbarTheme& theme = scrollbar.theme(); 343 ScrollbarTheme& theme = scrollbar.theme();
344 WebScrollbarThemePainter painter(theme, scrollbar, deviceScaleFactor); 344 WebScrollbarThemePainter painter(theme, scrollbar, deviceScaleFactor);
345 std::unique_ptr<WebScrollbarThemeGeometry> geometry( 345 std::unique_ptr<WebScrollbarThemeGeometry> geometry(
346 WebScrollbarThemeGeometryNative::create(theme)); 346 WebScrollbarThemeGeometryNative::create(theme));
347 347
348 std::unique_ptr<WebScrollbarLayer> scrollbarLayer = 348 std::unique_ptr<WebScrollbarLayer> scrollbarLayer;
349 Platform::current()->compositorSupport()->createScrollbarLayer( 349 if (theme.usesOverlayScrollbars() && theme.usesNinePatchThumbResource()) {
350 WebScrollbarImpl::create(&scrollbar), painter, std::move(geometry)); 350 scrollbarLayer =
351 Platform::current()->compositorSupport()->createOverlayScrollbarLayer(
352 WebScrollbarImpl::create(&scrollbar), painter, std::move(geometry));
353 } else {
354 scrollbarLayer =
355 Platform::current()->compositorSupport()->createScrollbarLayer(
356 WebScrollbarImpl::create(&scrollbar), painter, std::move(geometry));
357 }
351 GraphicsLayer::registerContentsLayer(scrollbarLayer->layer()); 358 GraphicsLayer::registerContentsLayer(scrollbarLayer->layer());
352 return scrollbarLayer; 359 return scrollbarLayer;
353 } 360 }
354 361
355 std::unique_ptr<WebScrollbarLayer> 362 std::unique_ptr<WebScrollbarLayer>
356 ScrollingCoordinator::createSolidColorScrollbarLayer( 363 ScrollingCoordinator::createSolidColorScrollbarLayer(
357 ScrollbarOrientation orientation, 364 ScrollbarOrientation orientation,
358 int thumbThickness, 365 int thumbThickness,
359 int trackStart, 366 int trackStart,
360 bool isLeftSideVerticalScrollbar) { 367 bool isLeftSideVerticalScrollbar) {
(...skipping 827 matching lines...) Expand 10 before | Expand all | Expand 10 after
1188 frameView ? toWebLayer(frameView->layoutViewportScrollableArea() 1195 frameView ? toWebLayer(frameView->layoutViewportScrollableArea()
1189 ->layerForScrolling()) 1196 ->layerForScrolling())
1190 : nullptr) { 1197 : nullptr) {
1191 return WebSize(frameView->layoutViewportScrollableArea()->contentsSize()) != 1198 return WebSize(frameView->layoutViewportScrollableArea()->contentsSize()) !=
1192 scrollLayer->bounds(); 1199 scrollLayer->bounds();
1193 } 1200 }
1194 return false; 1201 return false;
1195 } 1202 }
1196 1203
1197 } // namespace blink 1204 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698