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 2995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3006 | 3006 |
3007 void SkCanvas::drawDrawable(SkDrawable* dr, const SkMatrix* matrix) { | 3007 void SkCanvas::drawDrawable(SkDrawable* dr, const SkMatrix* matrix) { |
3008 RETURN_ON_NULL(dr); | 3008 RETURN_ON_NULL(dr); |
3009 if (matrix && matrix->isIdentity()) { | 3009 if (matrix && matrix->isIdentity()) { |
3010 matrix = nullptr; | 3010 matrix = nullptr; |
3011 } | 3011 } |
3012 this->onDrawDrawable(dr, matrix); | 3012 this->onDrawDrawable(dr, matrix); |
3013 } | 3013 } |
3014 | 3014 |
3015 void SkCanvas::onDrawDrawable(SkDrawable* dr, const SkMatrix* matrix) { | 3015 void SkCanvas::onDrawDrawable(SkDrawable* dr, const SkMatrix* matrix) { |
| 3016 // b/31304115 |
| 3017 // We cannot trust that the clip bounds are set correctly by the framework. |
| 3018 #ifndef SK_BUILD_FOR_ANDROID_FRAMEWORK |
3016 SkRect bounds = dr->getBounds(); | 3019 SkRect bounds = dr->getBounds(); |
3017 if (matrix) { | 3020 if (matrix) { |
3018 matrix->mapRect(&bounds); | 3021 matrix->mapRect(&bounds); |
3019 } | 3022 } |
3020 if (this->quickReject(bounds)) { | 3023 if (this->quickReject(bounds)) { |
3021 return; | 3024 return; |
3022 } | 3025 } |
| 3026 #endif |
| 3027 |
3023 dr->draw(this, matrix); | 3028 dr->draw(this, matrix); |
3024 } | 3029 } |
3025 | 3030 |
3026 void SkCanvas::onDrawAtlas(const SkImage* atlas, const SkRSXform xform[], const
SkRect tex[], | 3031 void SkCanvas::onDrawAtlas(const SkImage* atlas, const SkRSXform xform[], const
SkRect tex[], |
3027 const SkColor colors[], int count, SkXfermode::Mode m
ode, | 3032 const SkColor colors[], int count, SkXfermode::Mode m
ode, |
3028 const SkRect* cull, const SkPaint* paint) { | 3033 const SkRect* cull, const SkPaint* paint) { |
3029 if (cull && this->quickReject(*cull)) { | 3034 if (cull && this->quickReject(*cull)) { |
3030 return; | 3035 return; |
3031 } | 3036 } |
3032 | 3037 |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3504 | 3509 |
3505 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { | 3510 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { |
3506 fCanvas->restoreToCount(fSaveCount); | 3511 fCanvas->restoreToCount(fSaveCount); |
3507 } | 3512 } |
3508 | 3513 |
3509 #ifdef SK_SUPPORT_LEGACY_NEW_SURFACE_API | 3514 #ifdef SK_SUPPORT_LEGACY_NEW_SURFACE_API |
3510 SkSurface* SkCanvas::newSurface(const SkImageInfo& info, const SkSurfaceProps* p
rops) { | 3515 SkSurface* SkCanvas::newSurface(const SkImageInfo& info, const SkSurfaceProps* p
rops) { |
3511 return this->makeSurface(info, props).release(); | 3516 return this->makeSurface(info, props).release(); |
3512 } | 3517 } |
3513 #endif | 3518 #endif |
OLD | NEW |