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

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

Issue 399593007: Let blitters be notified when they're done being used (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove constructor definition. Created 6 years, 5 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/SkBlitter.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 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "SkScanPriv.h" 10 #include "SkScanPriv.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 } 101 }
102 102
103 /// Run-length-encoded supersampling antialiased blitter. 103 /// Run-length-encoded supersampling antialiased blitter.
104 class SuperBlitter : public BaseSuperBlitter { 104 class SuperBlitter : public BaseSuperBlitter {
105 public: 105 public:
106 SuperBlitter(SkBlitter* realBlitter, const SkIRect& ir, 106 SuperBlitter(SkBlitter* realBlitter, const SkIRect& ir,
107 const SkRegion& clip); 107 const SkRegion& clip);
108 108
109 virtual ~SuperBlitter() { 109 virtual ~SuperBlitter() {
110 this->flush(); 110 this->flush();
111 sk_free(fRunsBuffer);
112 } 111 }
113 112
114 /// Once fRuns contains a complete supersampled row, flush() blits 113 /// Once fRuns contains a complete supersampled row, flush() blits
115 /// it out through the wrapped blitter. 114 /// it out through the wrapped blitter.
116 void flush(); 115 void flush();
117 116
118 /// Blits a row of pixels, with location and width specified 117 /// Blits a row of pixels, with location and width specified
119 /// in supersampled coordinates. 118 /// in supersampled coordinates.
120 virtual void blitH(int x, int y, int width) SK_OVERRIDE; 119 virtual void blitH(int x, int y, int width) SK_OVERRIDE;
121 /// Blits a rectangle of pixels, with location and size specified 120 /// Blits a rectangle of pixels, with location and size specified
(...skipping 25 matching lines...) Expand all
147 fRuns.reset(fWidth); 146 fRuns.reset(fWidth);
148 } 147 }
149 148
150 int fOffsetX; 149 int fOffsetX;
151 }; 150 };
152 151
153 SuperBlitter::SuperBlitter(SkBlitter* realBlitter, const SkIRect& ir, 152 SuperBlitter::SuperBlitter(SkBlitter* realBlitter, const SkIRect& ir,
154 const SkRegion& clip) 153 const SkRegion& clip)
155 : BaseSuperBlitter(realBlitter, ir, clip) { 154 : BaseSuperBlitter(realBlitter, ir, clip) {
156 fRunsToBuffer = realBlitter->requestRowsPreserved(); 155 fRunsToBuffer = realBlitter->requestRowsPreserved();
157 fRunsBuffer = sk_malloc_throw(fRunsToBuffer * this->getRunsSz()); 156 fRunsBuffer = realBlitter->allocBlitMemory(fRunsToBuffer * this->getRunsSz() );
158 fCurrentRun = -1; 157 fCurrentRun = -1;
159 158
160 this->advanceRuns(); 159 this->advanceRuns();
161 160
162 fOffsetX = 0; 161 fOffsetX = 0;
163 } 162 }
164 163
165 void SuperBlitter::flush() { 164 void SuperBlitter::flush() {
166 if (fCurrIY >= fTop) { 165 if (fCurrIY >= fTop) {
167 166
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after
757 AntiFillPath(path, clip.bwRgn(), blitter); 756 AntiFillPath(path, clip.bwRgn(), blitter);
758 } else { 757 } else {
759 SkRegion tmp; 758 SkRegion tmp;
760 SkAAClipBlitter aaBlitter; 759 SkAAClipBlitter aaBlitter;
761 760
762 tmp.setRect(clip.getBounds()); 761 tmp.setRect(clip.getBounds());
763 aaBlitter.init(blitter, &clip.aaRgn()); 762 aaBlitter.init(blitter, &clip.aaRgn());
764 SkScan::AntiFillPath(path, tmp, &aaBlitter, true); 763 SkScan::AntiFillPath(path, tmp, &aaBlitter, true);
765 } 764 }
766 } 765 }
OLDNEW
« no previous file with comments | « src/core/SkBlitter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698