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 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 | 437 |
438 class AutoDrawLooper { | 438 class AutoDrawLooper { |
439 public: | 439 public: |
440 // "rawBounds" is the original bounds of the primitive about to be drawn, un
modified by the | 440 // "rawBounds" is the original bounds of the primitive about to be drawn, un
modified by the |
441 // paint. It's used to determine the size of the offscreen layer for filters
. | 441 // paint. It's used to determine the size of the offscreen layer for filters
. |
442 // If null, the clip will be used instead. | 442 // If null, the clip will be used instead. |
443 AutoDrawLooper(SkCanvas* canvas, const SkSurfaceProps& props, const SkPaint&
paint, | 443 AutoDrawLooper(SkCanvas* canvas, const SkSurfaceProps& props, const SkPaint&
paint, |
444 bool skipLayerForImageFilter = false, | 444 bool skipLayerForImageFilter = false, |
445 const SkRect* rawBounds = nullptr) : fOrigPaint(paint) { | 445 const SkRect* rawBounds = nullptr) : fOrigPaint(paint) { |
446 fCanvas = canvas; | 446 fCanvas = canvas; |
447 #ifdef SK_SUPPORT_LEGACY_DRAWFLTER | 447 #ifdef SK_SUPPORT_LEGACY_DRAWFILTER |
448 fFilter = canvas->getDrawFilter(); | 448 fFilter = canvas->getDrawFilter(); |
449 #else | 449 #else |
450 fFilter = nullptr; | 450 fFilter = nullptr; |
451 #endif | 451 #endif |
452 fPaint = &fOrigPaint; | 452 fPaint = &fOrigPaint; |
453 fSaveCount = canvas->getSaveCount(); | 453 fSaveCount = canvas->getSaveCount(); |
454 fTempLayerForImageFilter = false; | 454 fTempLayerForImageFilter = false; |
455 fDone = false; | 455 fDone = false; |
456 | 456 |
457 SkColorFilter* simplifiedCF = image_to_color_filter(fOrigPaint); | 457 SkColorFilter* simplifiedCF = image_to_color_filter(fOrigPaint); |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
775 // free up the contents of our deque | 775 // free up the contents of our deque |
776 this->restoreToCount(1); // restore everything but the last | 776 this->restoreToCount(1); // restore everything but the last |
777 | 777 |
778 this->internalRestore(); // restore the last, since we're going away | 778 this->internalRestore(); // restore the last, since we're going away |
779 | 779 |
780 delete fMetaData; | 780 delete fMetaData; |
781 | 781 |
782 dec_canvas(); | 782 dec_canvas(); |
783 } | 783 } |
784 | 784 |
785 #ifdef SK_SUPPORT_LEGACY_DRAWFLTER | 785 #ifdef SK_SUPPORT_LEGACY_DRAWFILTER |
786 SkDrawFilter* SkCanvas::getDrawFilter() const { | 786 SkDrawFilter* SkCanvas::getDrawFilter() const { |
787 return fMCRec->fFilter; | 787 return fMCRec->fFilter; |
788 } | 788 } |
789 | 789 |
790 SkDrawFilter* SkCanvas::setDrawFilter(SkDrawFilter* filter) { | 790 SkDrawFilter* SkCanvas::setDrawFilter(SkDrawFilter* filter) { |
791 this->checkForDeferredSave(); | 791 this->checkForDeferredSave(); |
792 SkRefCnt_SafeAssign(fMCRec->fFilter, filter); | 792 SkRefCnt_SafeAssign(fMCRec->fFilter, filter); |
793 return filter; | 793 return filter; |
794 } | 794 } |
795 #endif | 795 #endif |
(...skipping 2219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3015 } | 3015 } |
3016 | 3016 |
3017 if (matrix) { | 3017 if (matrix) { |
3018 canvas->concat(*matrix); | 3018 canvas->concat(*matrix); |
3019 } | 3019 } |
3020 } | 3020 } |
3021 | 3021 |
3022 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { | 3022 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { |
3023 fCanvas->restoreToCount(fSaveCount); | 3023 fCanvas->restoreToCount(fSaveCount); |
3024 } | 3024 } |
OLD | NEW |