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

Side by Side Diff: src/core/SkMultiPictureDraw.cpp

Issue 753253002: Use variable length key (rather than accumulated matrix) as save layer hoisting key (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: more cleanup Created 6 years 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
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 // Need to include something before #if SK_SUPPORT_GPU so that the Android 8 // Need to include something before #if SK_SUPPORT_GPU so that the Android
9 // framework build, which gets its defines from SkTypes rather than a makefile, 9 // framework build, which gets its defines from SkTypes rather than a makefile,
10 // has the definition before checking it. 10 // has the definition before checking it.
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 // Find the layers required by this canvas. It will return atlased 163 // Find the layers required by this canvas. It will return atlased
164 // layers in the 'recycled' list since they have already been drawn. 164 // layers in the 'recycled' list since they have already been drawn.
165 GrLayerHoister::FindLayersToHoist(context, picture, initialMatrix, 165 GrLayerHoister::FindLayersToHoist(context, picture, initialMatrix,
166 clipBounds, &needRendering, &recyc led, 166 clipBounds, &needRendering, &recyc led,
167 rt->numSamples()); 167 rt->numSamples());
168 168
169 GrLayerHoister::DrawLayers(context, needRendering); 169 GrLayerHoister::DrawLayers(context, needRendering);
170 170
171 GrReplacements replacements; 171 GrReplacements replacements;
172 172
173 GrLayerHoister::ConvertLayersToReplacements(needRendering, &replacem ents); 173 GrLayerHoister::ConvertLayersToReplacements(picture, needRendering, &replacements);
174 GrLayerHoister::ConvertLayersToReplacements(recycled, &replacements) ; 174 GrLayerHoister::ConvertLayersToReplacements(picture, recycled, &repl acements);
175 175
176 // Render the entire picture using new layers 176 // Render the entire picture using new layers
177 GrRecordReplaceDraw(picture, canvas, &replacements, initialMatrix, N ULL); 177 GrRecordReplaceDraw(picture, canvas, &replacements, initialMatrix, N ULL);
178 178
179 GrLayerHoister::UnlockLayers(context, needRendering); 179 GrLayerHoister::UnlockLayers(context, needRendering);
180 GrLayerHoister::UnlockLayers(context, recycled); 180 GrLayerHoister::UnlockLayers(context, recycled);
181 181
182 needRendering.rewind(); 182 needRendering.rewind();
183 recycled.rewind(); 183 recycled.rewind();
184 } else 184 } else
185 #endif 185 #endif
186 { 186 {
187 canvas->drawPicture(picture, &data.fMatrix, data.fPaint); 187 canvas->drawPicture(picture, &data.fMatrix, data.fPaint);
188 } 188 }
189 } 189 }
190 190
191 #if !defined(SK_IGNORE_GPU_LAYER_HOISTING) && SK_SUPPORT_GPU 191 #if !defined(SK_IGNORE_GPU_LAYER_HOISTING) && SK_SUPPORT_GPU
192 GrLayerHoister::UnlockLayers(context, atlasedNeedRendering); 192 GrLayerHoister::UnlockLayers(context, atlasedNeedRendering);
193 GrLayerHoister::UnlockLayers(context, atlasedRecycled); 193 GrLayerHoister::UnlockLayers(context, atlasedRecycled);
194 #if !GR_CACHE_HOISTED_LAYERS 194 #if !GR_CACHE_HOISTED_LAYERS
195 GrLayerHoister::PurgeCache(context); 195 GrLayerHoister::PurgeCache(context);
196 #endif 196 #endif
197 #endif 197 #endif
198 } 198 }
199 199
OLDNEW
« no previous file with comments | « src/core/SkLayerInfo.h ('k') | src/core/SkRecordDraw.cpp » ('j') | src/gpu/GrLayerCache.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698