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 "SkCanvas.h" | 8 #include "SkCanvas.h" |
9 #include "SkCanvasPriv.h" | 9 #include "SkCanvasPriv.h" |
10 #include "SkBitmapDevice.h" | 10 #include "SkBitmapDevice.h" |
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
582 SkDELETE(fMetaData); | 582 SkDELETE(fMetaData); |
583 | 583 |
584 dec_canvas(); | 584 dec_canvas(); |
585 } | 585 } |
586 | 586 |
587 SkDrawFilter* SkCanvas::getDrawFilter() const { | 587 SkDrawFilter* SkCanvas::getDrawFilter() const { |
588 return fMCRec->fFilter; | 588 return fMCRec->fFilter; |
589 } | 589 } |
590 | 590 |
591 SkDrawFilter* SkCanvas::setDrawFilter(SkDrawFilter* filter) { | 591 SkDrawFilter* SkCanvas::setDrawFilter(SkDrawFilter* filter) { |
| 592 this->checkForDeferredSave(); |
592 SkRefCnt_SafeAssign(fMCRec->fFilter, filter); | 593 SkRefCnt_SafeAssign(fMCRec->fFilter, filter); |
593 return filter; | 594 return filter; |
594 } | 595 } |
595 | 596 |
596 SkMetaData& SkCanvas::getMetaData() { | 597 SkMetaData& SkCanvas::getMetaData() { |
597 // metadata users are rare, so we lazily allocate it. If that changes we | 598 // metadata users are rare, so we lazily allocate it. If that changes we |
598 // can decide to just make it a field in the device (rather than a ptr) | 599 // can decide to just make it a field in the device (rather than a ptr) |
599 if (NULL == fMetaData) { | 600 if (NULL == fMetaData) { |
600 fMetaData = new SkMetaData; | 601 fMetaData = new SkMetaData; |
601 } | 602 } |
(...skipping 1957 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2559 } | 2560 } |
2560 | 2561 |
2561 if (matrix) { | 2562 if (matrix) { |
2562 canvas->concat(*matrix); | 2563 canvas->concat(*matrix); |
2563 } | 2564 } |
2564 } | 2565 } |
2565 | 2566 |
2566 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { | 2567 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { |
2567 fCanvas->restoreToCount(fSaveCount); | 2568 fCanvas->restoreToCount(fSaveCount); |
2568 } | 2569 } |
OLD | NEW |