OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2008 The Android Open Source Project | 2 * Copyright 2008 The Android Open Source Project |
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 #include "SkBitmapDevice.h" | 8 #include "SkBitmapDevice.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkCanvasPriv.h" | 10 #include "SkCanvasPriv.h" |
(...skipping 1128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1139 SkBitmap srcBM; | 1139 SkBitmap srcBM; |
1140 | 1140 |
1141 #if SK_SUPPORT_GPU | 1141 #if SK_SUPPORT_GPU |
1142 GrRenderTarget* srcRT = src->accessRenderTarget(); | 1142 GrRenderTarget* srcRT = src->accessRenderTarget(); |
1143 if (srcRT && !srcRT->asTexture() && dst->accessRenderTarget()) { | 1143 if (srcRT && !srcRT->asTexture() && dst->accessRenderTarget()) { |
1144 // When both the src & the dst are on the gpu but the src doesn't have a
texture, | 1144 // When both the src & the dst are on the gpu but the src doesn't have a
texture, |
1145 // we create a temporary texture for the draw. | 1145 // we create a temporary texture for the draw. |
1146 // TODO: we should actually only copy the portion of the source needed t
o apply the image | 1146 // TODO: we should actually only copy the portion of the source needed t
o apply the image |
1147 // filter | 1147 // filter |
1148 GrContext* context = srcRT->getContext(); | 1148 GrContext* context = srcRT->getContext(); |
1149 SkAutoTUnref<GrTexture> tex(context->textureProvider()->createTexture(sr
cRT->desc(), | 1149 SkAutoTUnref<GrTexture> tex(context->textureProvider()->createTexture(sr
cRT->desc(), true)); |
1150 Sk
Budgeted::kYes)); | |
1151 | 1150 |
1152 context->copySurface(tex, srcRT); | 1151 context->copySurface(tex, srcRT); |
1153 | 1152 |
1154 GrWrapTextureInBitmap(tex, src->width(), src->height(), src->isOpaque(),
&srcBM); | 1153 GrWrapTextureInBitmap(tex, src->width(), src->height(), src->isOpaque(),
&srcBM); |
1155 } else | 1154 } else |
1156 #endif | 1155 #endif |
1157 { | 1156 { |
1158 srcBM = src->accessBitmap(false); | 1157 srcBM = src->accessBitmap(false); |
1159 } | 1158 } |
1160 | 1159 |
(...skipping 1840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3001 } | 3000 } |
3002 | 3001 |
3003 if (matrix) { | 3002 if (matrix) { |
3004 canvas->concat(*matrix); | 3003 canvas->concat(*matrix); |
3005 } | 3004 } |
3006 } | 3005 } |
3007 | 3006 |
3008 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { | 3007 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { |
3009 fCanvas->restoreToCount(fSaveCount); | 3008 fCanvas->restoreToCount(fSaveCount); |
3010 } | 3009 } |
OLD | NEW |