OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009, 2010, 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 2231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2242 | 2242 |
2243 static void paintScrollbar(const Scrollbar* scrollbar, GraphicsContext& context,
const IntRect& clip) | 2243 static void paintScrollbar(const Scrollbar* scrollbar, GraphicsContext& context,
const IntRect& clip) |
2244 { | 2244 { |
2245 if (!scrollbar) | 2245 if (!scrollbar) |
2246 return; | 2246 return; |
2247 | 2247 |
2248 const IntRect& scrollbarRect = scrollbar->frameRect(); | 2248 const IntRect& scrollbarRect = scrollbar->frameRect(); |
2249 TransformRecorder transformRecorder(context, *scrollbar, AffineTransform::tr
anslation(-scrollbarRect.x(), -scrollbarRect.y())); | 2249 TransformRecorder transformRecorder(context, *scrollbar, AffineTransform::tr
anslation(-scrollbarRect.x(), -scrollbarRect.y())); |
2250 IntRect transformedClip = clip; | 2250 IntRect transformedClip = clip; |
2251 transformedClip.moveBy(scrollbarRect.location()); | 2251 transformedClip.moveBy(scrollbarRect.location()); |
2252 scrollbar->paint(&context, CullRect(transformedClip)); | 2252 scrollbar->paint(context, CullRect(transformedClip)); |
2253 } | 2253 } |
2254 | 2254 |
2255 // The following should be kept in sync with the code computing potential_new_re
corded_viewport in | 2255 // The following should be kept in sync with the code computing potential_new_re
corded_viewport in |
2256 // cc::DisplayListRecordingSource::UpdateAndExpandInvalidation() before we keep
only one copy of the algorithm. | 2256 // cc::DisplayListRecordingSource::UpdateAndExpandInvalidation() before we keep
only one copy of the algorithm. |
2257 static const int kPixelDistanceToRecord = 4000; | 2257 static const int kPixelDistanceToRecord = 4000; |
2258 | 2258 |
2259 IntRect CompositedLayerMapping::recomputeInterestRect(const GraphicsLayer* graph
icsLayer) const | 2259 IntRect CompositedLayerMapping::recomputeInterestRect(const GraphicsLayer* graph
icsLayer) const |
2260 { | 2260 { |
2261 FloatRect graphicsLayerBounds(FloatPoint(), graphicsLayer->size()); | 2261 FloatRect graphicsLayerBounds(FloatPoint(), graphicsLayer->size()); |
2262 | 2262 |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2407 } else if (graphicsLayer == m_squashingLayer.get()) { | 2407 } else if (graphicsLayer == m_squashingLayer.get()) { |
2408 for (size_t i = 0; i < m_squashedLayers.size(); ++i) | 2408 for (size_t i = 0; i < m_squashedLayers.size(); ++i) |
2409 doPaintTask(m_squashedLayers[i], *graphicsLayer, paintLayerFlags, &c
ontext, interestRect); | 2409 doPaintTask(m_squashedLayers[i], *graphicsLayer, paintLayerFlags, &c
ontext, interestRect); |
2410 } else if (graphicsLayer == layerForHorizontalScrollbar()) { | 2410 } else if (graphicsLayer == layerForHorizontalScrollbar()) { |
2411 paintScrollbar(m_owningLayer.scrollableArea()->horizontalScrollbar(), co
ntext, interestRect); | 2411 paintScrollbar(m_owningLayer.scrollableArea()->horizontalScrollbar(), co
ntext, interestRect); |
2412 } else if (graphicsLayer == layerForVerticalScrollbar()) { | 2412 } else if (graphicsLayer == layerForVerticalScrollbar()) { |
2413 paintScrollbar(m_owningLayer.scrollableArea()->verticalScrollbar(), cont
ext, interestRect); | 2413 paintScrollbar(m_owningLayer.scrollableArea()->verticalScrollbar(), cont
ext, interestRect); |
2414 } else if (graphicsLayer == layerForScrollCorner()) { | 2414 } else if (graphicsLayer == layerForScrollCorner()) { |
2415 IntPoint scrollCornerAndResizerLocation = m_owningLayer.scrollableArea()
->scrollCornerAndResizerRect().location(); | 2415 IntPoint scrollCornerAndResizerLocation = m_owningLayer.scrollableArea()
->scrollCornerAndResizerRect().location(); |
2416 CullRect cullRect(enclosingIntRect(interestRect)); | 2416 CullRect cullRect(enclosingIntRect(interestRect)); |
2417 ScrollableAreaPainter(*m_owningLayer.scrollableArea()).paintScrollCorner
(&context, -scrollCornerAndResizerLocation, cullRect); | 2417 ScrollableAreaPainter(*m_owningLayer.scrollableArea()).paintScrollCorner
(context, -scrollCornerAndResizerLocation, cullRect); |
2418 ScrollableAreaPainter(*m_owningLayer.scrollableArea()).paintResizer(&con
text, -scrollCornerAndResizerLocation, cullRect); | 2418 ScrollableAreaPainter(*m_owningLayer.scrollableArea()).paintResizer(cont
ext, -scrollCornerAndResizerLocation, cullRect); |
2419 } | 2419 } |
2420 InspectorInstrumentation::didPaint(m_owningLayer.layoutObject(), graphicsLay
er, &context, LayoutRect(interestRect)); | 2420 InspectorInstrumentation::didPaint(m_owningLayer.layoutObject(), graphicsLay
er, &context, LayoutRect(interestRect)); |
2421 #if ENABLE(ASSERT) | 2421 #if ENABLE(ASSERT) |
2422 if (Page* page = layoutObject()->frame()->page()) | 2422 if (Page* page = layoutObject()->frame()->page()) |
2423 page->setIsPainting(false); | 2423 page->setIsPainting(false); |
2424 #endif | 2424 #endif |
2425 } | 2425 } |
2426 | 2426 |
2427 bool CompositedLayerMapping::isTrackingPaintInvalidations() const | 2427 bool CompositedLayerMapping::isTrackingPaintInvalidations() const |
2428 { | 2428 { |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2602 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { | 2602 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { |
2603 name = "Scrolling Block Selection Layer"; | 2603 name = "Scrolling Block Selection Layer"; |
2604 } else { | 2604 } else { |
2605 ASSERT_NOT_REACHED(); | 2605 ASSERT_NOT_REACHED(); |
2606 } | 2606 } |
2607 | 2607 |
2608 return name; | 2608 return name; |
2609 } | 2609 } |
2610 | 2610 |
2611 } // namespace blink | 2611 } // namespace blink |
OLD | NEW |