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

Side by Side Diff: Source/core/css/resolver/StyleResourceLoader.cpp

Issue 381473002: Use reference for FillLayer if possible (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
4 * Copyright (C) 2013 Google Inc. All rights reserved. 4 * Copyright (C) 2013 Google Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 { 118 {
119 if (elementStyleResources.pendingImageProperties().isEmpty()) 119 if (elementStyleResources.pendingImageProperties().isEmpty())
120 return; 120 return;
121 121
122 PendingImagePropertyMap::const_iterator::Keys end = elementStyleResources.pe ndingImageProperties().end().keys(); 122 PendingImagePropertyMap::const_iterator::Keys end = elementStyleResources.pe ndingImageProperties().end().keys();
123 for (PendingImagePropertyMap::const_iterator::Keys it = elementStyleResource s.pendingImageProperties().begin().keys(); it != end; ++it) { 123 for (PendingImagePropertyMap::const_iterator::Keys it = elementStyleResource s.pendingImageProperties().begin().keys(); it != end; ++it) {
124 CSSPropertyID currentProperty = *it; 124 CSSPropertyID currentProperty = *it;
125 125
126 switch (currentProperty) { 126 switch (currentProperty) {
127 case CSSPropertyBackgroundImage: { 127 case CSSPropertyBackgroundImage: {
128 for (FillLayer* backgroundLayer = style->accessBackgroundLayers(); b ackgroundLayer; backgroundLayer = backgroundLayer->next()) { 128 for (FillLayer* backgroundLayer = &style->accessBackgroundLayers(); backgroundLayer; backgroundLayer = backgroundLayer->next()) {
129 if (backgroundLayer->image() && backgroundLayer->image()->isPend ingImage()) 129 if (backgroundLayer->image() && backgroundLayer->image()->isPend ingImage())
130 backgroundLayer->setImage(loadPendingImage(toStylePendingIma ge(backgroundLayer->image()), elementStyleResources.deviceScaleFactor())); 130 backgroundLayer->setImage(loadPendingImage(toStylePendingIma ge(backgroundLayer->image()), elementStyleResources.deviceScaleFactor()));
131 } 131 }
132 break; 132 break;
133 } 133 }
134 case CSSPropertyContent: { 134 case CSSPropertyContent: {
135 for (ContentData* contentData = const_cast<ContentData*>(style->cont entData()); contentData; contentData = contentData->next()) { 135 for (ContentData* contentData = const_cast<ContentData*>(style->cont entData()); contentData; contentData = contentData->next()) {
136 if (contentData->isImage()) { 136 if (contentData->isImage()) {
137 StyleImage* image = static_cast<ImageContentData*>(contentDa ta)->image(); 137 StyleImage* image = static_cast<ImageContentData*>(contentDa ta)->image();
138 if (image->isPendingImage()) { 138 if (image->isPendingImage()) {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 } 175 }
176 } 176 }
177 break; 177 break;
178 } 178 }
179 case CSSPropertyWebkitMaskBoxImageSource: { 179 case CSSPropertyWebkitMaskBoxImageSource: {
180 if (style->maskBoxImageSource() && style->maskBoxImageSource()->isPe ndingImage()) 180 if (style->maskBoxImageSource() && style->maskBoxImageSource()->isPe ndingImage())
181 style->setMaskBoxImageSource(loadPendingImage(toStylePendingImag e(style->maskBoxImageSource()), elementStyleResources.deviceScaleFactor())); 181 style->setMaskBoxImageSource(loadPendingImage(toStylePendingImag e(style->maskBoxImageSource()), elementStyleResources.deviceScaleFactor()));
182 break; 182 break;
183 } 183 }
184 case CSSPropertyWebkitMaskImage: { 184 case CSSPropertyWebkitMaskImage: {
185 for (FillLayer* maskLayer = style->accessMaskLayers(); maskLayer; ma skLayer = maskLayer->next()) { 185 for (FillLayer* maskLayer = &style->accessMaskLayers(); maskLayer; m askLayer = maskLayer->next()) {
186 if (maskLayer->image() && maskLayer->image()->isPendingImage()) 186 if (maskLayer->image() && maskLayer->image()->isPendingImage())
187 maskLayer->setImage(loadPendingImage(toStylePendingImage(mas kLayer->image()), elementStyleResources.deviceScaleFactor())); 187 maskLayer->setImage(loadPendingImage(toStylePendingImage(mas kLayer->image()), elementStyleResources.deviceScaleFactor()));
188 } 188 }
189 break; 189 break;
190 } 190 }
191 case CSSPropertyShapeOutside: 191 case CSSPropertyShapeOutside:
192 loadPendingShapeImage(style, style->shapeOutside(), elementStyleReso urces.deviceScaleFactor()); 192 loadPendingShapeImage(style, style->shapeOutside(), elementStyleReso urces.deviceScaleFactor());
193 break; 193 break;
194 default: 194 default:
195 ASSERT_NOT_REACHED(); 195 ASSERT_NOT_REACHED();
196 } 196 }
197 } 197 }
198 198
199 elementStyleResources.clearPendingImageProperties(); 199 elementStyleResources.clearPendingImageProperties();
200 } 200 }
201 201
202 void StyleResourceLoader::loadPendingResources(RenderStyle* renderStyle, Element StyleResources& elementStyleResources) 202 void StyleResourceLoader::loadPendingResources(RenderStyle* renderStyle, Element StyleResources& elementStyleResources)
203 { 203 {
204 // Start loading images referenced by this style. 204 // Start loading images referenced by this style.
205 loadPendingImages(renderStyle, elementStyleResources); 205 loadPendingImages(renderStyle, elementStyleResources);
206 206
207 // Start loading the SVG Documents referenced by this style. 207 // Start loading the SVG Documents referenced by this style.
208 loadPendingSVGDocuments(renderStyle, elementStyleResources); 208 loadPendingSVGDocuments(renderStyle, elementStyleResources);
209 } 209 }
210 210
211 } 211 }
OLDNEW
« no previous file with comments | « Source/core/css/resolver/AnimatedStyleBuilder.cpp ('k') | Source/core/rendering/InlineFlowBox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698