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())) { |
128 SkRect clipBounds; | 130 SkRect clipBounds; |
129 if (!data.fCanvas->getClipBounds(&clipBounds)) { | 131 if (!data.fCanvas->getClipBounds(&clipBounds)) { |
130 continue; | 132 continue; |
131 } | 133 } |
132 | 134 |
133 SkMatrix initialMatrix = data.fCanvas->getTotalMatrix(); | 135 SkMatrix initialMatrix = data.fCanvas->getTotalMatrix(); |
134 initialMatrix.preConcat(data.fMatrix); | 136 initialMatrix.preConcat(data.fMatrix); |
135 | 137 |
136 GrDrawContext* dc = data.fCanvas->internal_private_accessTopLayerDra
wContext(); | 138 GrDrawContext* dc = data.fCanvas->internal_private_accessTopLayerDra
wContext(); |
137 SkASSERT(dc); | 139 SkASSERT(dc); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 canvas->flush(); | 200 canvas->flush(); |
199 } | 201 } |
200 } | 202 } |
201 | 203 |
202 #if !defined(SK_IGNORE_GPU_LAYER_HOISTING) && SK_SUPPORT_GPU | 204 #if !defined(SK_IGNORE_GPU_LAYER_HOISTING) && SK_SUPPORT_GPU |
203 GrLayerHoister::UnlockLayers(context, atlasedNeedRendering); | 205 GrLayerHoister::UnlockLayers(context, atlasedNeedRendering); |
204 GrLayerHoister::UnlockLayers(context, atlasedRecycled); | 206 GrLayerHoister::UnlockLayers(context, atlasedRecycled); |
205 GrLayerHoister::End(context); | 207 GrLayerHoister::End(context); |
206 #endif | 208 #endif |
207 } | 209 } |
OLD | NEW |