Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(207)

Side by Side Diff: src/core/SkLiteDL.cpp

Issue 2254823002: SkLiteDL: inline empty() (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/core/SkLiteDL.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « src/core/SkLiteDL.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698