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

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

Issue 1406013006: Update Layer Hoisting to store its atlas texture in the resource cache (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix Android bug Created 5 years, 1 month 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
« no previous file with comments | « no previous file | src/gpu/GrLayerAtlas.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 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 109
110 #if !defined(SK_IGNORE_GPU_LAYER_HOISTING) && SK_SUPPORT_GPU 110 #if !defined(SK_IGNORE_GPU_LAYER_HOISTING) && SK_SUPPORT_GPU
111 GrContext* context = fGPUDrawData[0].fCanvas->getGrContext(); 111 GrContext* context = fGPUDrawData[0].fCanvas->getGrContext();
112 SkASSERT(context); 112 SkASSERT(context);
113 113
114 // Start by collecting all the layers that are going to be atlased and rende r 114 // Start by collecting all the layers that are going to be atlased and rende r
115 // them (if necessary). Hoisting the free floating layers is deferred until 115 // them (if necessary). Hoisting the free floating layers is deferred until
116 // drawing the canvas that requires them. 116 // drawing the canvas that requires them.
117 SkTDArray<GrHoistedLayer> atlasedNeedRendering, atlasedRecycled; 117 SkTDArray<GrHoistedLayer> atlasedNeedRendering, atlasedRecycled;
118 118
119 GrLayerHoister::Begin(context);
120
119 for (int i = 0; i < count; ++i) { 121 for (int i = 0; i < count; ++i) {
120 const DrawData& data = fGPUDrawData[i]; 122 const DrawData& data = fGPUDrawData[i];
121 // we only expect 1 context for all the canvases 123 // we only expect 1 context for all the canvases
122 SkASSERT(data.fCanvas->getGrContext() == context); 124 SkASSERT(data.fCanvas->getGrContext() == context);
123 125
124 if (!data.fPaint) { 126 if (!data.fPaint) {
125 SkRect clipBounds; 127 SkRect clipBounds;
126 if (!data.fCanvas->getClipBounds(&clipBounds)) { 128 if (!data.fCanvas->getClipBounds(&clipBounds)) {
127 continue; 129 continue;
128 } 130 }
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 canvas->drawPicture(picture, &data.fMatrix, data.fPaint); 194 canvas->drawPicture(picture, &data.fMatrix, data.fPaint);
193 } 195 }
194 if (flush) { 196 if (flush) {
195 canvas->flush(); 197 canvas->flush();
196 } 198 }
197 } 199 }
198 200
199 #if !defined(SK_IGNORE_GPU_LAYER_HOISTING) && SK_SUPPORT_GPU 201 #if !defined(SK_IGNORE_GPU_LAYER_HOISTING) && SK_SUPPORT_GPU
200 GrLayerHoister::UnlockLayers(context, atlasedNeedRendering); 202 GrLayerHoister::UnlockLayers(context, atlasedNeedRendering);
201 GrLayerHoister::UnlockLayers(context, atlasedRecycled); 203 GrLayerHoister::UnlockLayers(context, atlasedRecycled);
202 #if !GR_CACHE_HOISTED_LAYERS 204 GrLayerHoister::End(context);
203 GrLayerHoister::PurgeCache(context);
204 #endif
205 #endif 205 #endif
206 } 206 }
207 207
OLDNEW
« no previous file with comments | « no previous file | src/gpu/GrLayerAtlas.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698