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

Side by Side Diff: Source/core/layout/compositing/CompositedDeprecatedPaintLayerMapping.cpp

Issue 1218013003: Keep a cache of caret painters to avoid recomputing all the time. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: a shade of deduplication blue Created 5 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/paint/BlockPainter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 #include "core/layout/LayoutImage.h" 43 #include "core/layout/LayoutImage.h"
44 #include "core/layout/LayoutPart.h" 44 #include "core/layout/LayoutPart.h"
45 #include "core/layout/LayoutVideo.h" 45 #include "core/layout/LayoutVideo.h"
46 #include "core/layout/LayoutView.h" 46 #include "core/layout/LayoutView.h"
47 #include "core/layout/compositing/DeprecatedPaintLayerCompositor.h" 47 #include "core/layout/compositing/DeprecatedPaintLayerCompositor.h"
48 #include "core/page/ChromeClient.h" 48 #include "core/page/ChromeClient.h"
49 #include "core/page/Page.h" 49 #include "core/page/Page.h"
50 #include "core/page/scrolling/ScrollingCoordinator.h" 50 #include "core/page/scrolling/ScrollingCoordinator.h"
51 #include "core/paint/DeprecatedPaintLayerPainter.h" 51 #include "core/paint/DeprecatedPaintLayerPainter.h"
52 #include "core/paint/DeprecatedPaintLayerStackingNodeIterator.h" 52 #include "core/paint/DeprecatedPaintLayerStackingNodeIterator.h"
53 #include "core/paint/PaintDataCache.h"
53 #include "core/paint/ScrollableAreaPainter.h" 54 #include "core/paint/ScrollableAreaPainter.h"
54 #include "core/paint/TransformRecorder.h" 55 #include "core/paint/TransformRecorder.h"
55 #include "core/plugins/PluginView.h" 56 #include "core/plugins/PluginView.h"
56 #include "platform/LengthFunctions.h" 57 #include "platform/LengthFunctions.h"
57 #include "platform/RuntimeEnabledFeatures.h" 58 #include "platform/RuntimeEnabledFeatures.h"
58 #include "platform/fonts/FontCache.h" 59 #include "platform/fonts/FontCache.h"
59 #include "platform/geometry/TransformState.h" 60 #include "platform/geometry/TransformState.h"
60 #include "platform/graphics/GraphicsContext.h" 61 #include "platform/graphics/GraphicsContext.h"
61 #include "platform/graphics/paint/ClipDisplayItem.h" 62 #include "platform/graphics/paint/ClipDisplayItem.h"
62 #include "platform/graphics/paint/DisplayItemList.h" 63 #include "platform/graphics/paint/DisplayItemList.h"
(...skipping 2042 matching lines...) Expand 10 before | Expand all | Expand 10 after
2105 dirtyRect.move(roundedIntSize(paintInfo.paintLayer->subpixelAccumulation ())); 2106 dirtyRect.move(roundedIntSize(paintInfo.paintLayer->subpixelAccumulation ()));
2106 } 2107 }
2107 2108
2108 #if ENABLE(ASSERT) 2109 #if ENABLE(ASSERT)
2109 paintInfo.paintLayer->layoutObject()->assertSubtreeIsLaidOut(); 2110 paintInfo.paintLayer->layoutObject()->assertSubtreeIsLaidOut();
2110 #endif 2111 #endif
2111 2112
2112 float deviceScaleFactor = blink::deviceScaleFactor(paintInfo.paintLayer->lay outObject()->frame()); 2113 float deviceScaleFactor = blink::deviceScaleFactor(paintInfo.paintLayer->lay outObject()->frame());
2113 context->setDeviceScaleFactor(deviceScaleFactor); 2114 context->setDeviceScaleFactor(deviceScaleFactor);
2114 2115
2116 PaintDataCache paintDataCache;
2117 DeprecatedPaintLayerPaintingInfo paintingInfo(paintInfo.paintLayer, LayoutRe ct(dirtyRect), PaintBehaviorNormal, paintInfo.paintLayer->subpixelAccumulation() , nullptr, &paintDataCache);
2118 DeprecatedPaintLayerPainter painter(*paintInfo.paintLayer);
2119
2115 if (paintInfo.paintLayer->compositingState() != PaintsIntoGroupedBacking) { 2120 if (paintInfo.paintLayer->compositingState() != PaintsIntoGroupedBacking) {
2116 // FIXME: GraphicsLayers need a way to split for multicol. 2121 // FIXME: GraphicsLayers need a way to split for multicol.
2117 DeprecatedPaintLayerPaintingInfo paintingInfo(paintInfo.paintLayer, Layo utRect(dirtyRect), PaintBehaviorNormal, paintInfo.paintLayer->subpixelAccumulati on()); 2122 painter.paintLayerContents(context, paintingInfo, paintLayerFlags);
2118 DeprecatedPaintLayerPainter(*paintInfo.paintLayer).paintLayerContents(co ntext, paintingInfo, paintLayerFlags);
2119 2123
2120 if (paintInfo.paintLayer->containsDirtyOverlayScrollbars()) 2124 if (paintInfo.paintLayer->containsDirtyOverlayScrollbars())
2121 DeprecatedPaintLayerPainter(*paintInfo.paintLayer).paintLayerContent s(context, paintingInfo, paintLayerFlags | PaintLayerPaintingOverlayScrollbars); 2125 painter.paintLayerContents(context, paintingInfo, paintLayerFlags | PaintLayerPaintingOverlayScrollbars);
2122 } else { 2126 } else {
2123 DeprecatedPaintLayerPaintingInfo paintingInfo(paintInfo.paintLayer, Layo utRect(dirtyRect), PaintBehaviorNormal, paintInfo.paintLayer->subpixelAccumulati on());
2124
2125 // DeprecatedPaintLayer::paintLayer assumes that the caller clips to the passed rect. Squashed layers need to do this clipping in software, 2127 // DeprecatedPaintLayer::paintLayer assumes that the caller clips to the passed rect. Squashed layers need to do this clipping in software,
2126 // since there is no graphics layer to clip them precisely. Furthermore, in some cases we squash layers that need clipping in software 2128 // since there is no graphics layer to clip them precisely. Furthermore, in some cases we squash layers that need clipping in software
2127 // from clipping ancestors (see CompositedDeprecatedPaintLayerMapping::l ocalClipRectForSquashedLayer()). 2129 // from clipping ancestors (see CompositedDeprecatedPaintLayerMapping::l ocalClipRectForSquashedLayer()).
2128 // FIXME: Is it correct to clip to dirtyRect in slimming paint mode? 2130 // FIXME: Is it correct to clip to dirtyRect in slimming paint mode?
2129 // FIXME: Combine similar code here and LayerClipRecorder. 2131 // FIXME: Combine similar code here and LayerClipRecorder.
2130 dirtyRect.intersect(paintInfo.localClipRectForSquashedLayer); 2132 dirtyRect.intersect(paintInfo.localClipRectForSquashedLayer);
2131 { 2133 {
2132 if (context->displayItemList()) { 2134 if (context->displayItemList()) {
2133 ASSERT(RuntimeEnabledFeatures::slimmingPaintEnabled()); 2135 ASSERT(RuntimeEnabledFeatures::slimmingPaintEnabled());
2134 if (!context->displayItemList()->displayItemConstructionIsDisabl ed()) 2136 if (!context->displayItemList()->displayItemConstructionIsDisabl ed())
2135 context->displayItemList()->createAndAppend<ClipDisplayItem> (*this, DisplayItem::ClipLayerOverflowControls, dirtyRect); 2137 context->displayItemList()->createAndAppend<ClipDisplayItem> (*this, DisplayItem::ClipLayerOverflowControls, dirtyRect);
2136 } else { 2138 } else {
2137 ClipDisplayItem clipDisplayItem(*this, DisplayItem::ClipLayerOve rflowControls, dirtyRect); 2139 ClipDisplayItem clipDisplayItem(*this, DisplayItem::ClipLayerOve rflowControls, dirtyRect);
2138 clipDisplayItem.replay(*context); 2140 clipDisplayItem.replay(*context);
2139 } 2141 }
2140 } 2142 }
2141 DeprecatedPaintLayerPainter(*paintInfo.paintLayer).paintLayer(context, p aintingInfo, paintLayerFlags); 2143 painter.paintLayer(context, paintingInfo, paintLayerFlags);
2142 { 2144 {
2143 if (context->displayItemList()) { 2145 if (context->displayItemList()) {
2144 ASSERT(RuntimeEnabledFeatures::slimmingPaintEnabled()); 2146 ASSERT(RuntimeEnabledFeatures::slimmingPaintEnabled());
2145 if (!context->displayItemList()->displayItemConstructionIsDisabl ed()) { 2147 if (!context->displayItemList()->displayItemConstructionIsDisabl ed()) {
2146 if (context->displayItemList()->lastDisplayItemIsNoopBegin() ) 2148 if (context->displayItemList()->lastDisplayItemIsNoopBegin() )
2147 context->displayItemList()->removeLastDisplayItem(); 2149 context->displayItemList()->removeLastDisplayItem();
2148 else 2150 else
2149 context->displayItemList()->createAndAppend<EndClipDispl ayItem>(*this, DisplayItem::clipTypeToEndClipType(DisplayItem::ClipLayerOverflow Controls)); 2151 context->displayItemList()->createAndAppend<EndClipDispl ayItem>(*this, DisplayItem::clipTypeToEndClipType(DisplayItem::ClipLayerOverflow Controls));
2150 } 2152 }
2151 } else { 2153 } else {
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
2347 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { 2349 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) {
2348 name = "Scrolling Block Selection Layer"; 2350 name = "Scrolling Block Selection Layer";
2349 } else { 2351 } else {
2350 ASSERT_NOT_REACHED(); 2352 ASSERT_NOT_REACHED();
2351 } 2353 }
2352 2354
2353 return name; 2355 return name;
2354 } 2356 }
2355 2357
2356 } // namespace blink 2358 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/paint/BlockPainter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698