| 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 2265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2276 } | 2276 } |
| 2277 | 2277 |
| 2278 bool drawAsSprite = this->canDrawBitmapAsSprite(x, y, image->width(), image-
>height(), | 2278 bool drawAsSprite = this->canDrawBitmapAsSprite(x, y, image->width(), image-
>height(), |
| 2279 *paint); | 2279 *paint); |
| 2280 if (drawAsSprite && paint->getImageFilter()) { | 2280 if (drawAsSprite && paint->getImageFilter()) { |
| 2281 SkBitmap bitmap; | 2281 SkBitmap bitmap; |
| 2282 if (!as_IB(image)->asBitmapForImageFilters(&bitmap)) { | 2282 if (!as_IB(image)->asBitmapForImageFilters(&bitmap)) { |
| 2283 drawAsSprite = false; | 2283 drawAsSprite = false; |
| 2284 } else{ | 2284 } else{ |
| 2285 // Until imagefilters are updated, they cannot handle any src type b
ut N32... | 2285 // Until imagefilters are updated, they cannot handle any src type b
ut N32... |
| 2286 if (bitmap.info().colorType() != kN32_SkColorType || bitmap.info().i
sSRGB()) { | 2286 if (bitmap.info().colorType() != kN32_SkColorType || bitmap.info().g
ammaCloseToSRGB()) { |
| 2287 drawAsSprite = false; | 2287 drawAsSprite = false; |
| 2288 } | 2288 } |
| 2289 } | 2289 } |
| 2290 } | 2290 } |
| 2291 | 2291 |
| 2292 LOOPER_BEGIN_DRAWBITMAP(*paint, drawAsSprite, &bounds) | 2292 LOOPER_BEGIN_DRAWBITMAP(*paint, drawAsSprite, &bounds) |
| 2293 | 2293 |
| 2294 while (iter.next()) { | 2294 while (iter.next()) { |
| 2295 const SkPaint& pnt = looper.paint(); | 2295 const SkPaint& pnt = looper.paint(); |
| 2296 if (drawAsSprite && pnt.getImageFilter()) { | 2296 if (drawAsSprite && pnt.getImageFilter()) { |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2361 if (this->quickReject(paint->computeFastBounds(tmp, &tmp))) { | 2361 if (this->quickReject(paint->computeFastBounds(tmp, &tmp))) { |
| 2362 return; | 2362 return; |
| 2363 } | 2363 } |
| 2364 bounds = &storage; | 2364 bounds = &storage; |
| 2365 } | 2365 } |
| 2366 | 2366 |
| 2367 bool drawAsSprite = bounds && this->canDrawBitmapAsSprite(x, y, bitmap.width
(), bitmap.height(), | 2367 bool drawAsSprite = bounds && this->canDrawBitmapAsSprite(x, y, bitmap.width
(), bitmap.height(), |
| 2368 *paint); | 2368 *paint); |
| 2369 if (drawAsSprite && paint->getImageFilter()) { | 2369 if (drawAsSprite && paint->getImageFilter()) { |
| 2370 // Until imagefilters are updated, they cannot handle any src type but N
32... | 2370 // Until imagefilters are updated, they cannot handle any src type but N
32... |
| 2371 if (bitmap.info().colorType() != kN32_SkColorType || bitmap.info().isSRG
B()) { | 2371 if (bitmap.info().colorType() != kN32_SkColorType || bitmap.info().gamma
CloseToSRGB()) { |
| 2372 drawAsSprite = false; | 2372 drawAsSprite = false; |
| 2373 } | 2373 } |
| 2374 } | 2374 } |
| 2375 | 2375 |
| 2376 LOOPER_BEGIN_DRAWBITMAP(*paint, drawAsSprite, bounds) | 2376 LOOPER_BEGIN_DRAWBITMAP(*paint, drawAsSprite, bounds) |
| 2377 | 2377 |
| 2378 while (iter.next()) { | 2378 while (iter.next()) { |
| 2379 const SkPaint& pnt = looper.paint(); | 2379 const SkPaint& pnt = looper.paint(); |
| 2380 if (drawAsSprite && pnt.getImageFilter()) { | 2380 if (drawAsSprite && pnt.getImageFilter()) { |
| 2381 SkPoint pt; | 2381 SkPoint pt; |
| (...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3075 | 3075 |
| 3076 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { | 3076 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { |
| 3077 fCanvas->restoreToCount(fSaveCount); | 3077 fCanvas->restoreToCount(fSaveCount); |
| 3078 } | 3078 } |
| 3079 | 3079 |
| 3080 #ifdef SK_SUPPORT_LEGACY_NEW_SURFACE_API | 3080 #ifdef SK_SUPPORT_LEGACY_NEW_SURFACE_API |
| 3081 SkSurface* SkCanvas::newSurface(const SkImageInfo& info, const SkSurfaceProps* p
rops) { | 3081 SkSurface* SkCanvas::newSurface(const SkImageInfo& info, const SkSurfaceProps* p
rops) { |
| 3082 return this->makeSurface(info, props).release(); | 3082 return this->makeSurface(info, props).release(); |
| 3083 } | 3083 } |
| 3084 #endif | 3084 #endif |
| OLD | NEW |