OLD | NEW |
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 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 OwnPtr<WebScrollbarLayer> webScrollbarLayer; | 336 OwnPtr<WebScrollbarLayer> webScrollbarLayer; |
337 if (settings->useSolidColorScrollbars()) { | 337 if (settings->useSolidColorScrollbars()) { |
338 ASSERT(RuntimeEnabledFeatures::overlayScrollbarsEnabled()); | 338 ASSERT(RuntimeEnabledFeatures::overlayScrollbarsEnabled()); |
339 webScrollbarLayer = createSolidColorScrollbarLayer(orientation,
scrollbar->theme()->thumbThickness(scrollbar), scrollbar->theme()->trackPosition
(scrollbar), scrollableArea->shouldPlaceVerticalScrollbarOnLeft()); | 339 webScrollbarLayer = createSolidColorScrollbarLayer(orientation,
scrollbar->theme()->thumbThickness(scrollbar), scrollbar->theme()->trackPosition
(scrollbar), scrollableArea->shouldPlaceVerticalScrollbarOnLeft()); |
340 } else { | 340 } else { |
341 webScrollbarLayer = createScrollbarLayer(scrollbar); | 341 webScrollbarLayer = createScrollbarLayer(scrollbar); |
342 } | 342 } |
343 scrollbarLayer = addWebScrollbarLayer(scrollableArea, orientation, w
ebScrollbarLayer.release()); | 343 scrollbarLayer = addWebScrollbarLayer(scrollableArea, orientation, w
ebScrollbarLayer.release()); |
344 } | 344 } |
345 | 345 |
| 346 WebLayer* scrollLayer = toWebLayer(scrollableArea->layerForScrolling()); |
| 347 WebLayer* containerLayer = toWebLayer(scrollableArea->layerForContainer(
)); |
| 348 setupScrollbarLayer(scrollbarGraphicsLayer, scrollbarLayer, scrollLayer,
containerLayer); |
| 349 |
346 // Root layer non-overlay scrollbars should be marked opaque to disable | 350 // Root layer non-overlay scrollbars should be marked opaque to disable |
347 // blending. | 351 // blending. |
348 bool isOpaqueScrollbar = !scrollbar->isOverlayScrollbar(); | 352 bool isOpaqueScrollbar = !scrollbar->isOverlayScrollbar(); |
349 scrollbarGraphicsLayer->setContentsOpaque(isMainFrame && isOpaqueScrollb
ar); | 353 scrollbarGraphicsLayer->setContentsOpaque(isMainFrame && isOpaqueScrollb
ar); |
350 | |
351 WebLayer* scrollLayer = toWebLayer(scrollableArea->layerForScrolling()); | |
352 WebLayer* containerLayer = toWebLayer(scrollableArea->layerForContainer(
)); | |
353 setupScrollbarLayer(scrollbarGraphicsLayer, scrollbarLayer, scrollLayer,
containerLayer); | |
354 } else | 354 } else |
355 removeWebScrollbarLayer(scrollableArea, orientation); | 355 removeWebScrollbarLayer(scrollableArea, orientation); |
356 } | 356 } |
357 | 357 |
358 bool ScrollingCoordinator::scrollableAreaScrollLayerDidChange(ScrollableArea* sc
rollableArea) | 358 bool ScrollingCoordinator::scrollableAreaScrollLayerDidChange(ScrollableArea* sc
rollableArea) |
359 { | 359 { |
360 GraphicsLayer* scrollLayer = scrollableArea->layerForScrolling(); | 360 GraphicsLayer* scrollLayer = scrollableArea->layerForScrolling(); |
361 | 361 |
362 if (scrollLayer) { | 362 if (scrollLayer) { |
363 ASSERT(m_page); | 363 ASSERT(m_page); |
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
984 bool frameIsScrollable = frameView && frameView->isScrollable(); | 984 bool frameIsScrollable = frameView && frameView->isScrollable(); |
985 if (frameIsScrollable != m_wasFrameScrollable) | 985 if (frameIsScrollable != m_wasFrameScrollable) |
986 return true; | 986 return true; |
987 | 987 |
988 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll
ing()) : 0) | 988 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll
ing()) : 0) |
989 return blink::WebSize(frameView->contentsSize()) != scrollLayer->bounds(
); | 989 return blink::WebSize(frameView->contentsSize()) != scrollLayer->bounds(
); |
990 return false; | 990 return false; |
991 } | 991 } |
992 | 992 |
993 } // namespace blink | 993 } // namespace blink |
OLD | NEW |