| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 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 #define __STDC_LIMIT_MACROS | 7 #define __STDC_LIMIT_MACROS |
| 8 | 8 |
| 9 #include "SkDraw.h" | 9 #include "SkDraw.h" |
| 10 #include "SkBlitter.h" | 10 #include "SkBlitter.h" |
| (...skipping 1222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1233 SkCanvas c(device); | 1233 SkCanvas c(device); |
| 1234 // need the unclipped top/left for the translate | 1234 // need the unclipped top/left for the translate |
| 1235 c.translate(-SkIntToScalar(mask.fBounds.fLeft), | 1235 c.translate(-SkIntToScalar(mask.fBounds.fLeft), |
| 1236 -SkIntToScalar(mask.fBounds.fTop)); | 1236 -SkIntToScalar(mask.fBounds.fTop)); |
| 1237 c.concat(*fMatrix); | 1237 c.concat(*fMatrix); |
| 1238 | 1238 |
| 1239 // We can't call drawBitmap, or we'll infinitely recurse. Instead | 1239 // We can't call drawBitmap, or we'll infinitely recurse. Instead |
| 1240 // we manually build a shader and draw that into our new mask | 1240 // we manually build a shader and draw that into our new mask |
| 1241 SkPaint tmpPaint; | 1241 SkPaint tmpPaint; |
| 1242 tmpPaint.setFlags(paint.getFlags()); | 1242 tmpPaint.setFlags(paint.getFlags()); |
| 1243 tmpPaint.setFilterQuality(paint.getFilterQuality()); |
| 1243 SkAutoBitmapShaderInstall install(bitmap, tmpPaint); | 1244 SkAutoBitmapShaderInstall install(bitmap, tmpPaint); |
| 1244 SkRect rr; | 1245 SkRect rr; |
| 1245 rr.set(0, 0, SkIntToScalar(bitmap.width()), | 1246 rr.set(0, 0, SkIntToScalar(bitmap.width()), |
| 1246 SkIntToScalar(bitmap.height())); | 1247 SkIntToScalar(bitmap.height())); |
| 1247 c.drawRect(rr, install.paintWithShader()); | 1248 c.drawRect(rr, install.paintWithShader()); |
| 1248 } | 1249 } |
| 1249 this->drawDevMask(mask, paint); | 1250 this->drawDevMask(mask, paint); |
| 1250 } | 1251 } |
| 1251 } | 1252 } |
| 1252 | 1253 |
| (...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2079 mask->fImage = SkMask::AllocImage(size); | 2080 mask->fImage = SkMask::AllocImage(size); |
| 2080 memset(mask->fImage, 0, mask->computeImageSize()); | 2081 memset(mask->fImage, 0, mask->computeImageSize()); |
| 2081 } | 2082 } |
| 2082 | 2083 |
| 2083 if (SkMask::kJustComputeBounds_CreateMode != mode) { | 2084 if (SkMask::kJustComputeBounds_CreateMode != mode) { |
| 2084 draw_into_mask(*mask, devPath, style); | 2085 draw_into_mask(*mask, devPath, style); |
| 2085 } | 2086 } |
| 2086 | 2087 |
| 2087 return true; | 2088 return true; |
| 2088 } | 2089 } |
| OLD | NEW |