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 1143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1154 | 1154 |
1155 GrWrapTextureInBitmap(tex, src->width(), src->height(), src->isOpaque(),
&srcBM); | 1155 GrWrapTextureInBitmap(tex, src->width(), src->height(), src->isOpaque(),
&srcBM); |
1156 } else | 1156 } else |
1157 #endif | 1157 #endif |
1158 { | 1158 { |
1159 srcBM = src->accessBitmap(false); | 1159 srcBM = src->accessBitmap(false); |
1160 } | 1160 } |
1161 | 1161 |
1162 SkCanvas c(dst); | 1162 SkCanvas c(dst); |
1163 | 1163 |
| 1164 SkAutoTUnref<SkImageFilter> localF(filter->newWithLocalMatrix(ctm)); |
1164 SkPaint p; | 1165 SkPaint p; |
1165 p.setImageFilter(filter->makeWithLocalMatrix(ctm)); | 1166 p.setImageFilter(localF); |
1166 const SkScalar x = SkIntToScalar(src->getOrigin().x()); | 1167 const SkScalar x = SkIntToScalar(src->getOrigin().x()); |
1167 const SkScalar y = SkIntToScalar(src->getOrigin().y()); | 1168 const SkScalar y = SkIntToScalar(src->getOrigin().y()); |
1168 c.drawBitmap(srcBM, x, y, &p); | 1169 c.drawBitmap(srcBM, x, y, &p); |
1169 } | 1170 } |
1170 | 1171 |
1171 static SkImageInfo make_layer_info(const SkImageInfo& prev, int w, int h, bool i
sOpaque, | 1172 static SkImageInfo make_layer_info(const SkImageInfo& prev, int w, int h, bool i
sOpaque, |
1172 const SkPaint* paint) { | 1173 const SkPaint* paint) { |
1173 // need to force L32 for now if we have an image filter. Once filters suppor
t other colortypes | 1174 // need to force L32 for now if we have an image filter. Once filters suppor
t other colortypes |
1174 // e.g. sRGB or F16, we can remove this check | 1175 // e.g. sRGB or F16, we can remove this check |
1175 const bool hasImageFilter = paint && paint->getImageFilter(); | 1176 const bool hasImageFilter = paint && paint->getImageFilter(); |
(...skipping 1864 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3040 | 3041 |
3041 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { | 3042 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { |
3042 fCanvas->restoreToCount(fSaveCount); | 3043 fCanvas->restoreToCount(fSaveCount); |
3043 } | 3044 } |
3044 | 3045 |
3045 #ifdef SK_SUPPORT_LEGACY_NEW_SURFACE_API | 3046 #ifdef SK_SUPPORT_LEGACY_NEW_SURFACE_API |
3046 SkSurface* SkCanvas::newSurface(const SkImageInfo& info, const SkSurfaceProps* p
rops) { | 3047 SkSurface* SkCanvas::newSurface(const SkImageInfo& info, const SkSurfaceProps* p
rops) { |
3047 return this->makeSurface(info, props).release(); | 3048 return this->makeSurface(info, props).release(); |
3048 } | 3049 } |
3049 #endif | 3050 #endif |
OLD | NEW |