| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 Google Inc. |
| 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 "SkData.h" | 9 #include "SkData.h" |
| 10 #include "SkImageFilter.h" | 10 #include "SkImageFilter.h" |
| (...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 779 SkMatrix original = canvas->getTotalMatrix(); | 779 SkMatrix original = canvas->getTotalMatrix(); |
| 780 this->map(draw_fns, canvas, original); | 780 this->map(draw_fns, canvas, original); |
| 781 } | 781 } |
| 782 void SkLiteDL::optimizeFor (GrContext* ctx) { this->map(optimize_for_fns, ctx)
; } | 782 void SkLiteDL::optimizeFor (GrContext* ctx) { this->map(optimize_for_fns, ctx)
; } |
| 783 void SkLiteDL::makeThreadsafe() { this->map(make_threadsafe_fns);
} | 783 void SkLiteDL::makeThreadsafe() { this->map(make_threadsafe_fns);
} |
| 784 | 784 |
| 785 SkRect SkLiteDL::onGetBounds() { | 785 SkRect SkLiteDL::onGetBounds() { |
| 786 return fBounds; | 786 return fBounds; |
| 787 } | 787 } |
| 788 | 788 |
| 789 bool SkLiteDL::empty() const { | |
| 790 return fUsed == 0; | |
| 791 } | |
| 792 | |
| 793 SkLiteDL:: SkLiteDL(SkRect bounds) : fUsed(0), fReserved(0), fBounds(bounds) {} | 789 SkLiteDL:: SkLiteDL(SkRect bounds) : fUsed(0), fReserved(0), fBounds(bounds) {} |
| 794 | 790 |
| 795 SkLiteDL::~SkLiteDL() { | 791 SkLiteDL::~SkLiteDL() { |
| 796 this->reset(SkRect::MakeEmpty()); | 792 this->reset(SkRect::MakeEmpty()); |
| 797 } | 793 } |
| 798 | 794 |
| 799 sk_sp<SkLiteDL> SkLiteDL::New(SkRect bounds) { | 795 sk_sp<SkLiteDL> SkLiteDL::New(SkRect bounds) { |
| 800 return sk_sp<SkLiteDL>(new SkLiteDL(bounds)); | 796 return sk_sp<SkLiteDL>(new SkLiteDL(bounds)); |
| 801 } | 797 } |
| 802 | 798 |
| 803 void SkLiteDL::reset(SkRect bounds) { | 799 void SkLiteDL::reset(SkRect bounds) { |
| 804 SkASSERT(this->unique()); | 800 SkASSERT(this->unique()); |
| 805 this->map(dtor_fns); | 801 this->map(dtor_fns); |
| 806 | 802 |
| 807 // Leave fBytes and fReserved alone. | 803 // Leave fBytes and fReserved alone. |
| 808 fUsed = 0; | 804 fUsed = 0; |
| 809 fBounds = bounds; | 805 fBounds = bounds; |
| 810 } | 806 } |
| OLD | NEW |