Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 56 using blink::WebLayerTreeView; | 56 using blink::WebLayerTreeView; |
| 57 using blink::WebScrollbar; | 57 using blink::WebScrollbar; |
| 58 using blink::WebScrollbarLayer; | 58 using blink::WebScrollbarLayer; |
| 59 using WebCore::FrameHost; | 59 using WebCore::FrameHost; |
| 60 using WebCore::GraphicsLayer; | 60 using WebCore::GraphicsLayer; |
| 61 using WebCore::GraphicsLayerFactory; | 61 using WebCore::GraphicsLayerFactory; |
| 62 | 62 |
| 63 namespace WebCore { | 63 namespace WebCore { |
| 64 | 64 |
| 65 PinchViewport::PinchViewport(FrameHost& owner) | 65 PinchViewport::PinchViewport(FrameHost& owner) |
| 66 : m_owner(owner) | 66 : m_frameHost(owner) |
| 67 { | 67 { |
| 68 } | 68 } |
| 69 | 69 |
| 70 PinchViewport::~PinchViewport() { } | 70 PinchViewport::~PinchViewport() { } |
| 71 | 71 |
| 72 void PinchViewport::setViewportSize(const WebCore::IntSize& newSize) | 72 void PinchViewport::setSize(const IntSize& newSize) |
| 73 { | 73 { |
| 74 // TODO: This is currently called from WebViewImpl with the main frame size which | |
| 75 // is (or will be) incorrect, address in future patches. | |
| 76 | |
| 74 if (!m_innerViewportContainerLayer || !m_innerViewportScrollLayer) | 77 if (!m_innerViewportContainerLayer || !m_innerViewportScrollLayer) |
| 75 return; | 78 return; |
| 76 | 79 |
| 77 m_innerViewportContainerLayer->setSize(newSize); | 80 m_innerViewportContainerLayer->setSize(newSize); |
| 78 // The innerviewport scroll layer always has the same size as its clip layer , but | 81 // The innerviewport scroll layer always has the same size as its clip layer , but |
| 79 // the page scale layer lives between them, allowing for non-zero max scroll | 82 // the page scale layer lives between them, allowing for non-zero max scroll |
| 80 // offset when page scale > 1. | 83 // offset when page scale > 1. |
| 81 m_innerViewportScrollLayer->setSize(newSize); | 84 m_innerViewportScrollLayer->setSize(newSize); |
| 82 | 85 |
| 83 // Need to re-compute sizes for the overlay scrollbars. | 86 // Need to re-compute sizes for the overlay scrollbars. |
| 84 setupScrollbar(WebScrollbar::Horizontal); | 87 setupScrollbar(WebScrollbar::Horizontal); |
| 85 setupScrollbar(WebScrollbar::Vertical); | 88 setupScrollbar(WebScrollbar::Vertical); |
| 86 } | 89 } |
| 87 | 90 |
| 91 void PinchViewport::setLocation(const IntPoint& newLocation) | |
| 92 { | |
| 93 // TODO: The update from the LayerTree will occur here before the scale delt a is applied. | |
| 94 // this means that the clamping below may be incorrect. Once scaling is done in PinchViewport | |
| 95 // change it so they happen at the same time. | |
| 96 | |
| 97 // Clamp the location within our extents. | |
| 98 IntPoint location(newLocation); | |
| 99 location.shrunkTo(maximumScrollPosition()); | |
| 100 location.expandedTo(minimumScrollPosition()); | |
| 101 | |
| 102 m_visibleRect.setLocation(newLocation); | |
| 103 | |
| 104 ScrollingCoordinator* coordinator = m_frameHost.page().scrollingCoordinator( ); | |
| 105 ASSERT(coordinator); | |
| 106 | |
| 107 coordinator->scrollableAreaScrollLayerDidChange(this); | |
| 108 } | |
| 109 | |
| 88 // Modifies the top of the graphics layer tree to add layers needed to support | 110 // Modifies the top of the graphics layer tree to add layers needed to support |
| 89 // the inner/outer viewport fixed-position model for pinch zoom. When finished, | 111 // the inner/outer viewport fixed-position model for pinch zoom. When finished, |
| 90 // the tree will look like this (with * denoting added layers): | 112 // the tree will look like this (with * denoting added layers): |
| 91 // | 113 // |
| 92 // *innerViewportContainerLayer (fixed pos container) | 114 // *innerViewportContainerLayer (fixed pos container) |
| 93 // +- *pageScaleLayer | 115 // +- *pageScaleLayer |
| 94 // | +- *innerViewportScrollLayer | 116 // | +- *innerViewportScrollLayer |
| 95 // | +-- overflowControlsHostLayer (root layer) | 117 // | +-- overflowControlsHostLayer (root layer) |
| 96 // | +-- rootTransformLayer (optional) | 118 // | +-- rootTransformLayer (optional) |
| 97 // | +-- outerViewportContainerLayer (fixed pos container) [frame container layer in RenderLayerCompositor] | 119 // | +-- outerViewportContainerLayer (fixed pos container) [frame container layer in RenderLayerCompositor] |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 118 && !m_overlayScrollbarVertical | 140 && !m_overlayScrollbarVertical |
| 119 && !m_pageScaleLayer | 141 && !m_pageScaleLayer |
| 120 && !m_innerViewportContainerLayer); | 142 && !m_innerViewportContainerLayer); |
| 121 | 143 |
| 122 m_innerViewportContainerLayer = GraphicsLayer::create(graphicsLayerFacto ry, this); | 144 m_innerViewportContainerLayer = GraphicsLayer::create(graphicsLayerFacto ry, this); |
| 123 m_pageScaleLayer = GraphicsLayer::create(graphicsLayerFactory, this); | 145 m_pageScaleLayer = GraphicsLayer::create(graphicsLayerFactory, this); |
| 124 m_innerViewportScrollLayer = GraphicsLayer::create(graphicsLayerFactory, this); | 146 m_innerViewportScrollLayer = GraphicsLayer::create(graphicsLayerFactory, this); |
| 125 m_overlayScrollbarHorizontal = GraphicsLayer::create(graphicsLayerFactor y, this); | 147 m_overlayScrollbarHorizontal = GraphicsLayer::create(graphicsLayerFactor y, this); |
| 126 m_overlayScrollbarVertical = GraphicsLayer::create(graphicsLayerFactory, this); | 148 m_overlayScrollbarVertical = GraphicsLayer::create(graphicsLayerFactory, this); |
| 127 | 149 |
| 128 WebCore::ScrollingCoordinator* coordinator = m_owner.page().scrollingCoo rdinator(); | 150 WebCore::ScrollingCoordinator* coordinator = m_frameHost.page().scrollin gCoordinator(); |
| 129 ASSERT(coordinator); | 151 ASSERT(coordinator); |
| 130 coordinator->setLayerIsContainerForFixedPositionLayers(m_innerViewportSc rollLayer.get(), true); | 152 coordinator->setLayerIsContainerForFixedPositionLayers(m_innerViewportSc rollLayer.get(), true); |
| 131 | 153 |
| 132 // No need for the inner viewport to clip, since the compositing | 154 // No need for the inner viewport to clip, since the compositing |
| 133 // surface takes care of it -- and clipping here would interfere with | 155 // surface takes care of it -- and clipping here would interfere with |
| 134 // dynamically-sized viewports on Android. | 156 // dynamically-sized viewports on Android. |
| 135 m_innerViewportContainerLayer->setMasksToBounds(false); | 157 m_innerViewportContainerLayer->setMasksToBounds(false); |
| 136 | 158 |
| 137 m_innerViewportScrollLayer->platformLayer()->setScrollClipLayer( | 159 m_innerViewportScrollLayer->platformLayer()->setScrollClipLayer( |
| 138 m_innerViewportContainerLayer->platformLayer()); | 160 m_innerViewportContainerLayer->platformLayer()); |
| 139 m_innerViewportScrollLayer->platformLayer()->setUserScrollable(true, tru e); | 161 m_innerViewportScrollLayer->platformLayer()->setUserScrollable(true, tru e); |
| 140 | 162 |
| 141 m_innerViewportContainerLayer->addChild(m_pageScaleLayer.get()); | 163 m_innerViewportContainerLayer->addChild(m_pageScaleLayer.get()); |
| 142 m_pageScaleLayer->addChild(m_innerViewportScrollLayer.get()); | 164 m_pageScaleLayer->addChild(m_innerViewportScrollLayer.get()); |
| 143 m_innerViewportContainerLayer->addChild(m_overlayScrollbarHorizontal.get ()); | 165 m_innerViewportContainerLayer->addChild(m_overlayScrollbarHorizontal.get ()); |
| 144 m_innerViewportContainerLayer->addChild(m_overlayScrollbarVertical.get() ); | 166 m_innerViewportContainerLayer->addChild(m_overlayScrollbarVertical.get() ); |
| 145 | 167 |
| 168 // Ensure this class is set as the scroll layer's ScrollableArea | |
| 169 coordinator->scrollableAreaScrollLayerDidChange(this); | |
| 170 | |
| 146 // Setup the inner viewport overlay scrollbars. | 171 // Setup the inner viewport overlay scrollbars. |
| 147 setupScrollbar(WebScrollbar::Horizontal); | 172 setupScrollbar(WebScrollbar::Horizontal); |
| 148 setupScrollbar(WebScrollbar::Vertical); | 173 setupScrollbar(WebScrollbar::Vertical); |
| 149 } | 174 } |
| 150 | 175 |
| 151 m_innerViewportScrollLayer->removeAllChildren(); | 176 m_innerViewportScrollLayer->removeAllChildren(); |
| 152 m_innerViewportScrollLayer->addChild(currentLayerTreeRoot); | 177 m_innerViewportScrollLayer->addChild(currentLayerTreeRoot); |
| 153 | 178 |
| 154 // We only need to disable the existing (outer viewport) scrollbars | 179 // We only need to disable the existing (outer viewport) scrollbars |
| 155 // if the existing ones are already overlay. | 180 // if the existing ones are already overlay. |
| 156 // FIXME: If we knew in advance before the overflowControlsHostLayer goes | 181 // FIXME: If we knew in advance before the overflowControlsHostLayer goes |
| 157 // away, we would re-enable the drawing of these scrollbars. | 182 // away, we would re-enable the drawing of these scrollbars. |
| 158 // FIXME: This doesn't seem to work (at least on Android). Commenting out fo r now until | 183 // FIXME: This doesn't seem to work (at least on Android). Commenting out fo r now until |
| 159 // I figure out how to access RenderLayerCompositor from here. | 184 // I figure out how to access RenderLayerCompositor from here. |
| 160 // if (GraphicsLayer* scrollbar = m_owner->compositor()->layerForHorizontalS crollbar()) | 185 // if (GraphicsLayer* scrollbar = m_frameHost->compositor()->layerForHorizon talScrollbar()) |
| 161 // scrollbar->setDrawsContent(!page->mainFrame()->view()->hasOverlayScrol lbars()); | 186 // scrollbar->setDrawsContent(!page->mainFrame()->view()->hasOverlayScrol lbars()); |
| 162 // if (GraphicsLayer* scrollbar = m_owner->compositor()->layerForVerticalScr ollbar()) | 187 // if (GraphicsLayer* scrollbar = m_frameHost->compositor()->layerForVertica lScrollbar()) |
| 163 // scrollbar->setDrawsContent(!page->mainFrame()->view()->hasOverlayScrol lbars()); | 188 // scrollbar->setDrawsContent(!page->mainFrame()->view()->hasOverlayScrol lbars()); |
| 164 } | 189 } |
| 165 | 190 |
| 166 void PinchViewport::setupScrollbar(WebScrollbar::Orientation orientation) | 191 void PinchViewport::setupScrollbar(WebScrollbar::Orientation orientation) |
| 167 { | 192 { |
| 168 bool isHorizontal = orientation == WebScrollbar::Horizontal; | 193 bool isHorizontal = orientation == WebScrollbar::Horizontal; |
| 169 GraphicsLayer* scrollbarGraphicsLayer = isHorizontal ? | 194 GraphicsLayer* scrollbarGraphicsLayer = isHorizontal ? |
| 170 m_overlayScrollbarHorizontal.get() : m_overlayScrollbarVertical.get(); | 195 m_overlayScrollbarHorizontal.get() : m_overlayScrollbarVertical.get(); |
| 171 OwnPtr<WebScrollbarLayer>& webScrollbarLayer = isHorizontal ? | 196 OwnPtr<WebScrollbarLayer>& webScrollbarLayer = isHorizontal ? |
| 172 m_webOverlayScrollbarHorizontal : m_webOverlayScrollbarVertical; | 197 m_webOverlayScrollbarHorizontal : m_webOverlayScrollbarVertical; |
| 173 | 198 |
| 174 const int overlayScrollbarThickness = m_owner.settings().pinchOverlayScrollb arThickness(); | 199 const int overlayScrollbarThickness = m_frameHost.settings().pinchOverlayScr ollbarThickness(); |
| 175 | 200 |
| 176 if (!webScrollbarLayer) { | 201 if (!webScrollbarLayer) { |
| 177 WebCore::ScrollingCoordinator* coordinator = m_owner.page().scrollingCoo rdinator(); | 202 ScrollingCoordinator* coordinator = m_frameHost.page().scrollingCoordina tor(); |
| 178 ASSERT(coordinator); | 203 ASSERT(coordinator); |
| 179 WebCore::ScrollbarOrientation webcoreOrientation = isHorizontal ? WebCor e::HorizontalScrollbar : WebCore::VerticalScrollbar; | 204 ScrollbarOrientation webcoreOrientation = isHorizontal ? HorizontalScrol lbar : VerticalScrollbar; |
| 180 webScrollbarLayer = coordinator->createSolidColorScrollbarLayer(webcoreO rientation, overlayScrollbarThickness, false); | 205 webScrollbarLayer = coordinator->createSolidColorScrollbarLayer(webcoreO rientation, overlayScrollbarThickness, false); |
| 181 | 206 |
| 182 webScrollbarLayer->setClipLayer(m_innerViewportContainerLayer->platformL ayer()); | 207 webScrollbarLayer->setClipLayer(m_innerViewportContainerLayer->platformL ayer()); |
| 183 scrollbarGraphicsLayer->setContentsToPlatformLayer(webScrollbarLayer->la yer()); | 208 scrollbarGraphicsLayer->setContentsToPlatformLayer(webScrollbarLayer->la yer()); |
| 184 scrollbarGraphicsLayer->setDrawsContent(false); | 209 scrollbarGraphicsLayer->setDrawsContent(false); |
| 185 } | 210 } |
| 186 | 211 |
| 187 int xPosition = isHorizontal ? 0 : m_innerViewportContainerLayer->size().wid th() - overlayScrollbarThickness; | 212 int xPosition = isHorizontal ? 0 : m_innerViewportContainerLayer->size().wid th() - overlayScrollbarThickness; |
| 188 int yPosition = isHorizontal ? m_innerViewportContainerLayer->size().height( ) - overlayScrollbarThickness : 0; | 213 int yPosition = isHorizontal ? m_innerViewportContainerLayer->size().height( ) - overlayScrollbarThickness : 0; |
| 189 int width = isHorizontal ? m_innerViewportContainerLayer->size().width() - o verlayScrollbarThickness : overlayScrollbarThickness; | 214 int width = isHorizontal ? m_innerViewportContainerLayer->size().width() - o verlayScrollbarThickness : overlayScrollbarThickness; |
| 190 int height = isHorizontal ? overlayScrollbarThickness : m_innerViewportConta inerLayer->size().height() - overlayScrollbarThickness; | 215 int height = isHorizontal ? overlayScrollbarThickness : m_innerViewportConta inerLayer->size().height() - overlayScrollbarThickness; |
| 191 | 216 |
| 192 // Use the GraphicsLayer to position the scrollbars. | 217 // Use the GraphicsLayer to position the scrollbars. |
| 193 scrollbarGraphicsLayer->setPosition(WebCore::IntPoint(xPosition, yPosition)) ; | 218 scrollbarGraphicsLayer->setPosition(IntPoint(xPosition, yPosition)); |
| 194 scrollbarGraphicsLayer->setSize(WebCore::IntSize(width, height)); | 219 scrollbarGraphicsLayer->setSize(IntSize(width, height)); |
| 195 scrollbarGraphicsLayer->setContentsRect(WebCore::IntRect(0, 0, width, height )); | 220 scrollbarGraphicsLayer->setContentsRect(IntRect(0, 0, width, height)); |
| 196 } | 221 } |
| 197 | 222 |
| 198 void PinchViewport::registerViewportLayersWithTreeView(WebLayerTreeView* layerTr eeView) const | 223 void PinchViewport::registerLayersWithTreeView(WebLayerTreeView* layerTreeView) const |
| 199 { | 224 { |
| 200 ASSERT(layerTreeView); | 225 ASSERT(layerTreeView); |
| 201 ASSERT(m_owner.page().mainFrame()); | 226 ASSERT(m_frameHost.page().mainFrame()); |
| 202 ASSERT(m_owner.page().mainFrame()->contentRenderer()); | 227 ASSERT(m_frameHost.page().mainFrame()->contentRenderer()); |
| 203 | 228 |
| 204 WebCore::RenderLayerCompositor* compositor = m_owner.page().mainFrame()->con tentRenderer()->compositor(); | 229 RenderLayerCompositor* compositor = m_frameHost.page().mainFrame()->contentR enderer()->compositor(); |
| 205 // Get the outer viewport scroll layer. | 230 // Get the outer viewport scroll layer. |
| 206 WebLayer* scrollLayer = compositor->scrollLayer()->platformLayer(); | 231 WebLayer* scrollLayer = compositor->scrollLayer()->platformLayer(); |
| 207 | 232 |
| 208 m_webOverlayScrollbarHorizontal->setScrollLayer(scrollLayer); | 233 m_webOverlayScrollbarHorizontal->setScrollLayer(scrollLayer); |
| 209 m_webOverlayScrollbarVertical->setScrollLayer(scrollLayer); | 234 m_webOverlayScrollbarVertical->setScrollLayer(scrollLayer); |
| 210 | 235 |
| 211 ASSERT(compositor); | 236 ASSERT(compositor); |
| 212 layerTreeView->registerViewportLayers( | 237 layerTreeView->registerViewportLayers( |
| 213 m_pageScaleLayer->platformLayer(), | 238 m_pageScaleLayer->platformLayer(), |
| 214 m_innerViewportScrollLayer->platformLayer(), | 239 m_innerViewportScrollLayer->platformLayer(), |
| 215 scrollLayer); | 240 scrollLayer); |
| 216 } | 241 } |
| 217 | 242 |
| 218 void PinchViewport::clearViewportLayersForTreeView(WebLayerTreeView* layerTreeVi ew) const | 243 void PinchViewport::clearLayersForTreeView(WebLayerTreeView* layerTreeView) cons t |
| 219 { | 244 { |
| 220 ASSERT(layerTreeView); | 245 ASSERT(layerTreeView); |
| 221 | 246 |
| 222 layerTreeView->clearViewportLayers(); | 247 layerTreeView->clearViewportLayers(); |
| 223 } | 248 } |
| 224 | 249 |
| 250 int PinchViewport::scrollSize(ScrollbarOrientation orientation) const | |
| 251 { | |
| 252 IntSize scrollDimensions = maximumScrollPosition() - minimumScrollPosition() ; | |
| 253 return (orientation == HorizontalScrollbar) ? scrollDimensions.width() : scr ollDimensions.height(); | |
| 254 } | |
| 255 | |
| 256 IntPoint PinchViewport::minimumScrollPosition() const | |
| 257 { | |
| 258 return IntPoint(); | |
| 259 } | |
| 260 | |
| 261 IntPoint PinchViewport::maximumScrollPosition() const | |
| 262 { | |
| 263 // TODO: Doesn't take scale into account yet. | |
| 264 IntPoint maxScrollPosition(contentsSize() - visibleRect().size()); | |
| 265 maxScrollPosition.clampNegativeToZero(); | |
| 266 return maxScrollPosition; | |
| 267 } | |
| 268 | |
| 269 IntRect PinchViewport::scrollableAreaBoundingBox() const | |
| 270 { | |
| 271 // This method should return the bounding box in the parent view's coordinat e | |
| 272 // space; however, PinchViewport technically isn't a child of any Frames. | |
| 273 // Nonetheless, the PinchViewport always occupies the entire main frame so j ust | |
| 274 // return that. | |
| 275 LocalFrame* frame = m_frameHost.page().mainFrame(); | |
| 276 | |
| 277 if (!frame || !frame->view()) | |
| 278 return IntRect(); | |
| 279 | |
| 280 return frame->view()->frameRect(); | |
| 281 } | |
| 282 | |
| 283 IntSize PinchViewport::contentsSize() const | |
| 284 { | |
| 285 LocalFrame* frame = m_frameHost.page().mainFrame(); | |
| 286 | |
| 287 if (!frame || !frame->view()) | |
| 288 return IntSize(); | |
| 289 | |
| 290 // TODO: This will be visibleContentSize once page scale is removed from Fra meView | |
| 291 return frame->view()->unscaledVisibleContentSize(IncludeScrollbars); | |
| 292 } | |
| 293 | |
| 294 void PinchViewport::invalidateScrollbarRect(Scrollbar*, const IntRect&) | |
| 295 { | |
| 296 // Do nothing. Pinch scrollbars live on the compositor thread and will | |
| 297 // be updated when the viewport is synced to the CC. | |
| 298 } | |
| 299 | |
| 300 void PinchViewport::setScrollOffset(const IntPoint& offset) | |
| 301 { | |
| 302 setLocation(offset); | |
| 303 } | |
| 304 | |
| 305 int PinchViewport::pageStep(ScrollbarOrientation orientation) const | |
| 306 { | |
| 307 // TODO: This should be ScrollableArea's default implementation. | |
|
aelias_OOO_until_Jul13
2014/03/24 21:47:24
Could you do that now? I think it shouldn't touch
bokan
2014/03/24 23:36:30
Done. I removed the override on RenderLayerScrolla
aelias_OOO_until_Jul13
2014/03/25 00:05:48
It seems more correct not to include scrollbars, t
aelias_OOO_until_Jul13
2014/03/25 00:07:02
Err, sorry, I misunderstood the direction of the c
bokan
2014/03/25 00:54:42
Done.
| |
| 308 int length = (orientation == HorizontalScrollbar) ? visibleWidth() : visible Height(); | |
| 309 int minPageStep = static_cast<float>(length) * minFractionToStepWhenPaging() ; | |
| 310 int pageStep = std::max(minPageStep, length - maxOverlapBetweenPages()); | |
| 311 | |
| 312 return std::max(pageStep, 1); | |
| 313 } | |
| 314 | |
| 315 GraphicsLayer* PinchViewport::layerForContainer() const OVERRIDE | |
| 316 { | |
| 317 return m_innerViewportContainerLayer.get(); | |
| 318 } | |
| 319 | |
| 320 GraphicsLayer* PinchViewport::layerForScrolling() const OVERRIDE | |
| 321 { | |
| 322 return m_innerViewportScrollLayer.get(); | |
| 323 } | |
| 324 | |
| 325 GraphicsLayer* PinchViewport::layerForHorizontalScrollbar() const OVERRIDE | |
| 326 { | |
| 327 return m_overlayScrollbarHorizontal.get(); | |
| 328 } | |
| 329 | |
| 330 GraphicsLayer* PinchViewport::layerForVerticalScrollbar() const OVERRIDE | |
| 331 { | |
| 332 return m_overlayScrollbarVertical.get(); | |
| 333 } | |
| 334 | |
| 225 void PinchViewport::notifyAnimationStarted(const GraphicsLayer*, double monotoni cTime) | 335 void PinchViewport::notifyAnimationStarted(const GraphicsLayer*, double monotoni cTime) |
| 226 { | 336 { |
| 227 } | 337 } |
| 228 | 338 |
| 229 void PinchViewport::paintContents(const GraphicsLayer*, WebCore::GraphicsContext &, WebCore::GraphicsLayerPaintingPhase, const WebCore::IntRect& inClip) | 339 void PinchViewport::paintContents(const GraphicsLayer*, GraphicsContext&, Graphi csLayerPaintingPhase, const IntRect& inClip) |
| 230 { | 340 { |
| 231 } | 341 } |
| 232 | 342 |
| 233 String PinchViewport::debugName(const GraphicsLayer* graphicsLayer) | 343 String PinchViewport::debugName(const GraphicsLayer* graphicsLayer) |
| 234 { | 344 { |
| 235 String name; | 345 String name; |
| 236 if (graphicsLayer == m_innerViewportContainerLayer.get()) { | 346 if (graphicsLayer == m_innerViewportContainerLayer.get()) { |
| 237 name = "Inner Viewport Container Layer"; | 347 name = "Inner Viewport Container Layer"; |
| 238 } else if (graphicsLayer == m_pageScaleLayer.get()) { | 348 } else if (graphicsLayer == m_pageScaleLayer.get()) { |
| 239 name = "Page Scale Layer"; | 349 name = "Page Scale Layer"; |
| 240 } else if (graphicsLayer == m_innerViewportScrollLayer.get()) { | 350 } else if (graphicsLayer == m_innerViewportScrollLayer.get()) { |
| 241 name = "Inner Viewport Scroll Layer"; | 351 name = "Inner Viewport Scroll Layer"; |
| 242 } else if (graphicsLayer == m_overlayScrollbarHorizontal.get()) { | 352 } else if (graphicsLayer == m_overlayScrollbarHorizontal.get()) { |
| 243 name = "Overlay Scrollbar Horizontal Layer"; | 353 name = "Overlay Scrollbar Horizontal Layer"; |
| 244 } else if (graphicsLayer == m_overlayScrollbarVertical.get()) { | 354 } else if (graphicsLayer == m_overlayScrollbarVertical.get()) { |
| 245 name = "Overlay Scrollbar Vertical Layer"; | 355 name = "Overlay Scrollbar Vertical Layer"; |
| 246 } else { | 356 } else { |
| 247 ASSERT_NOT_REACHED(); | 357 ASSERT_NOT_REACHED(); |
| 248 } | 358 } |
| 249 | 359 |
| 250 return name; | 360 return name; |
| 251 } | 361 } |
| 252 | 362 |
| 253 } // namespace WebCore | 363 } // namespace WebCore |
| OLD | NEW |