| 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 17 matching lines...) Expand all Loading... |
| 28 void SkMultiPictureDraw::DrawData::init(SkCanvas* canvas, const SkPicture* pictu
re, | 28 void SkMultiPictureDraw::DrawData::init(SkCanvas* canvas, const SkPicture* pictu
re, |
| 29 const SkMatrix* matrix, const SkPaint* p
aint) { | 29 const SkMatrix* matrix, const SkPaint* p
aint) { |
| 30 fPicture = SkRef(picture); | 30 fPicture = SkRef(picture); |
| 31 fCanvas = SkRef(canvas); | 31 fCanvas = SkRef(canvas); |
| 32 if (matrix) { | 32 if (matrix) { |
| 33 fMatrix = *matrix; | 33 fMatrix = *matrix; |
| 34 } else { | 34 } else { |
| 35 fMatrix.setIdentity(); | 35 fMatrix.setIdentity(); |
| 36 } | 36 } |
| 37 if (paint) { | 37 if (paint) { |
| 38 fPaint = SkNEW_ARGS(SkPaint, (*paint)); | 38 fPaint = new SkPaint(*paint); |
| 39 } else { | 39 } else { |
| 40 fPaint = NULL; | 40 fPaint = NULL; |
| 41 } | 41 } |
| 42 } | 42 } |
| 43 | 43 |
| 44 void SkMultiPictureDraw::DrawData::Reset(SkTDArray<DrawData>& data) { | 44 void SkMultiPictureDraw::DrawData::Reset(SkTDArray<DrawData>& data) { |
| 45 for (int i = 0; i < data.count(); ++i) { | 45 for (int i = 0; i < data.count(); ++i) { |
| 46 data[i].fPicture->unref(); | 46 data[i].fPicture->unref(); |
| 47 data[i].fCanvas->unref(); | 47 data[i].fCanvas->unref(); |
| 48 SkDELETE(data[i].fPaint); | 48 delete data[i].fPaint; |
| 49 } | 49 } |
| 50 data.rewind(); | 50 data.rewind(); |
| 51 } | 51 } |
| 52 | 52 |
| 53 ////////////////////////////////////////////////////////////////////////////////
////// | 53 ////////////////////////////////////////////////////////////////////////////////
////// |
| 54 | 54 |
| 55 SkMultiPictureDraw::SkMultiPictureDraw(int reserve) { | 55 SkMultiPictureDraw::SkMultiPictureDraw(int reserve) { |
| 56 if (reserve > 0) { | 56 if (reserve > 0) { |
| 57 fGPUDrawData.setReserve(reserve); | 57 fGPUDrawData.setReserve(reserve); |
| 58 fThreadSafeDrawData.setReserve(reserve); | 58 fThreadSafeDrawData.setReserve(reserve); |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 | 198 |
| 199 #if !defined(SK_IGNORE_GPU_LAYER_HOISTING) && SK_SUPPORT_GPU | 199 #if !defined(SK_IGNORE_GPU_LAYER_HOISTING) && SK_SUPPORT_GPU |
| 200 GrLayerHoister::UnlockLayers(context, atlasedNeedRendering); | 200 GrLayerHoister::UnlockLayers(context, atlasedNeedRendering); |
| 201 GrLayerHoister::UnlockLayers(context, atlasedRecycled); | 201 GrLayerHoister::UnlockLayers(context, atlasedRecycled); |
| 202 #if !GR_CACHE_HOISTED_LAYERS | 202 #if !GR_CACHE_HOISTED_LAYERS |
| 203 GrLayerHoister::PurgeCache(context); | 203 GrLayerHoister::PurgeCache(context); |
| 204 #endif | 204 #endif |
| 205 #endif | 205 #endif |
| 206 } | 206 } |
| 207 | 207 |
| OLD | NEW |