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 2809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2820 * against the playback cost of recursing into the subpicture to get at its act
ual ops. | 2820 * against the playback cost of recursing into the subpicture to get at its act
ual ops. |
2821 * | 2821 * |
2822 * For now we pick a conservatively small value, though measurement (and other
heuristics like | 2822 * For now we pick a conservatively small value, though measurement (and other
heuristics like |
2823 * the type of ops contained) may justify changing this value. | 2823 * the type of ops contained) may justify changing this value. |
2824 */ | 2824 */ |
2825 #define kMaxPictureOpsToUnrollInsteadOfRef 1 | 2825 #define kMaxPictureOpsToUnrollInsteadOfRef 1 |
2826 | 2826 |
2827 void SkCanvas::drawPicture(const SkPicture* picture, const SkMatrix* matrix, con
st SkPaint* paint) { | 2827 void SkCanvas::drawPicture(const SkPicture* picture, const SkMatrix* matrix, con
st SkPaint* paint) { |
2828 RETURN_ON_NULL(picture); | 2828 RETURN_ON_NULL(picture); |
2829 | 2829 |
2830 TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawPicture()"); | 2830 TRACE_EVENT0("pras, disabled-by-default-skia", "SkCanvas::drawPicture()"); |
2831 if (matrix && matrix->isIdentity()) { | 2831 if (matrix && matrix->isIdentity()) { |
2832 matrix = nullptr; | 2832 matrix = nullptr; |
2833 } | 2833 } |
2834 if (picture->approximateOpCount() <= kMaxPictureOpsToUnrollInsteadOfRef) { | 2834 if (picture->approximateOpCount() <= kMaxPictureOpsToUnrollInsteadOfRef) { |
2835 SkAutoCanvasMatrixPaint acmp(this, matrix, paint, picture->cullRect()); | 2835 SkAutoCanvasMatrixPaint acmp(this, matrix, paint, picture->cullRect()); |
2836 picture->playback(this); | 2836 picture->playback(this); |
2837 } else { | 2837 } else { |
2838 this->onDrawPicture(picture, matrix, paint); | 2838 this->onDrawPicture(picture, matrix, paint); |
2839 } | 2839 } |
2840 } | 2840 } |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2964 } | 2964 } |
2965 | 2965 |
2966 if (matrix) { | 2966 if (matrix) { |
2967 canvas->concat(*matrix); | 2967 canvas->concat(*matrix); |
2968 } | 2968 } |
2969 } | 2969 } |
2970 | 2970 |
2971 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { | 2971 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { |
2972 fCanvas->restoreToCount(fSaveCount); | 2972 fCanvas->restoreToCount(fSaveCount); |
2973 } | 2973 } |
OLD | NEW |