| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |