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 2953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2964 LOOPER_END | 2964 LOOPER_END |
2965 } | 2965 } |
2966 | 2966 |
2967 void SkCanvas::drawPatch(const SkPoint cubics[12], const SkColor colors[4], | 2967 void SkCanvas::drawPatch(const SkPoint cubics[12], const SkColor colors[4], |
2968 const SkPoint texCoords[4], SkXfermode* xmode, const Sk Paint& paint) { | 2968 const SkPoint texCoords[4], SkXfermode* xmode, const Sk Paint& paint) { |
2969 TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawPatch()"); | 2969 TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawPatch()"); |
2970 if (nullptr == cubics) { | 2970 if (nullptr == cubics) { |
2971 return; | 2971 return; |
2972 } | 2972 } |
2973 | 2973 |
2974 this->onDrawPatch(cubics, colors, texCoords, xmode, paint); | |
reed1
2016/09/21 17:30:30
definitely a good change -- we should not quickrej
| |
2975 } | |
2976 | |
2977 void SkCanvas::onDrawPatch(const SkPoint cubics[12], const SkColor colors[4], | |
2978 const SkPoint texCoords[4], SkXfermode* xmode, const SkPaint& paint) { | |
2974 // Since a patch is always within the convex hull of the control points, we discard it when its | 2979 // Since a patch is always within the convex hull of the control points, we discard it when its |
2975 // bounding rectangle is completely outside the current clip. | 2980 // bounding rectangle is completely outside the current clip. |
2976 SkRect bounds; | 2981 SkRect bounds; |
2977 bounds.set(cubics, SkPatchUtils::kNumCtrlPts); | 2982 bounds.set(cubics, SkPatchUtils::kNumCtrlPts); |
2978 if (this->quickReject(bounds)) { | 2983 if (this->quickReject(bounds)) { |
2979 return; | 2984 return; |
2980 } | 2985 } |
2981 | 2986 |
2982 this->onDrawPatch(cubics, colors, texCoords, xmode, paint); | |
2983 } | |
2984 | |
2985 void SkCanvas::onDrawPatch(const SkPoint cubics[12], const SkColor colors[4], | |
2986 const SkPoint texCoords[4], SkXfermode* xmode, const SkPaint& paint) { | |
2987 | |
2988 LOOPER_BEGIN(paint, SkDrawFilter::kPath_Type, nullptr) | 2987 LOOPER_BEGIN(paint, SkDrawFilter::kPath_Type, nullptr) |
2989 | 2988 |
2990 while (iter.next()) { | 2989 while (iter.next()) { |
2991 iter.fDevice->drawPatch(iter, cubics, colors, texCoords, xmode, paint); | 2990 iter.fDevice->drawPatch(iter, cubics, colors, texCoords, xmode, paint); |
2992 } | 2991 } |
2993 | 2992 |
2994 LOOPER_END | 2993 LOOPER_END |
2995 } | 2994 } |
2996 | 2995 |
2997 void SkCanvas::drawDrawable(SkDrawable* dr, SkScalar x, SkScalar y) { | 2996 void SkCanvas::drawDrawable(SkDrawable* dr, SkScalar x, SkScalar y) { |
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3504 | 3503 |
3505 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { | 3504 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { |
3506 fCanvas->restoreToCount(fSaveCount); | 3505 fCanvas->restoreToCount(fSaveCount); |
3507 } | 3506 } |
3508 | 3507 |
3509 #ifdef SK_SUPPORT_LEGACY_NEW_SURFACE_API | 3508 #ifdef SK_SUPPORT_LEGACY_NEW_SURFACE_API |
3510 SkSurface* SkCanvas::newSurface(const SkImageInfo& info, const SkSurfaceProps* p rops) { | 3509 SkSurface* SkCanvas::newSurface(const SkImageInfo& info, const SkSurfaceProps* p rops) { |
3511 return this->makeSurface(info, props).release(); | 3510 return this->makeSurface(info, props).release(); |
3512 } | 3511 } |
3513 #endif | 3512 #endif |
OLD | NEW |