| 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 // drawing the canvas that requires them. | 117 // drawing the canvas that requires them. |
| 118 SkTDArray<GrHoistedLayer> atlasedNeedRendering, atlasedRecycled; | 118 SkTDArray<GrHoistedLayer> atlasedNeedRendering, atlasedRecycled; |
| 119 | 119 |
| 120 GrLayerHoister::Begin(context); | 120 GrLayerHoister::Begin(context); |
| 121 | 121 |
| 122 for (int i = 0; i < count; ++i) { | 122 for (int i = 0; i < count; ++i) { |
| 123 const DrawData& data = fGPUDrawData[i]; | 123 const DrawData& data = fGPUDrawData[i]; |
| 124 // we only expect 1 context for all the canvases | 124 // we only expect 1 context for all the canvases |
| 125 SkASSERT(data.fCanvas->getGrContext() == context); | 125 SkASSERT(data.fCanvas->getGrContext() == context); |
| 126 | 126 |
| 127 if (!data.fPaint && | 127 if (!data.fPaint) { |
| 128 (kRGBA_8888_SkColorType == data.fCanvas->imageInfo().colorType() || | |
| 129 kBGRA_8888_SkColorType == data.fCanvas->imageInfo().colorType())) { | |
| 130 SkRect clipBounds; | 128 SkRect clipBounds; |
| 131 if (!data.fCanvas->getClipBounds(&clipBounds)) { | 129 if (!data.fCanvas->getClipBounds(&clipBounds)) { |
| 132 continue; | 130 continue; |
| 133 } | 131 } |
| 134 | 132 |
| 135 SkMatrix initialMatrix = data.fCanvas->getTotalMatrix(); | 133 SkMatrix initialMatrix = data.fCanvas->getTotalMatrix(); |
| 136 initialMatrix.preConcat(data.fMatrix); | 134 initialMatrix.preConcat(data.fMatrix); |
| 137 | 135 |
| 138 GrDrawContext* dc = data.fCanvas->internal_private_accessTopLayerDra
wContext(); | 136 GrDrawContext* dc = data.fCanvas->internal_private_accessTopLayerDra
wContext(); |
| 139 SkASSERT(dc); | 137 SkASSERT(dc); |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 canvas->flush(); | 198 canvas->flush(); |
| 201 } | 199 } |
| 202 } | 200 } |
| 203 | 201 |
| 204 #if !defined(SK_IGNORE_GPU_LAYER_HOISTING) && SK_SUPPORT_GPU | 202 #if !defined(SK_IGNORE_GPU_LAYER_HOISTING) && SK_SUPPORT_GPU |
| 205 GrLayerHoister::UnlockLayers(context, atlasedNeedRendering); | 203 GrLayerHoister::UnlockLayers(context, atlasedNeedRendering); |
| 206 GrLayerHoister::UnlockLayers(context, atlasedRecycled); | 204 GrLayerHoister::UnlockLayers(context, atlasedRecycled); |
| 207 GrLayerHoister::End(context); | 205 GrLayerHoister::End(context); |
| 208 #endif | 206 #endif |
| 209 } | 207 } |
| OLD | NEW |