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

Side by Side Diff: src/utils/SkPictureUtils.cpp

Issue 15894005: Moving updateClipConservativelyUsingBounds into SkCanvas (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 6 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 | Annotate | Revision Log
« src/core/SkCanvas.cpp ('K') | « src/core/SkPictureRecord.cpp ('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 2012 Google Inc. 2 * Copyright 2012 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 "SkPictureUtils.h" 8 #include "SkPictureUtils.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkData.h" 10 #include "SkData.h"
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 // disable aa for speed 173 // disable aa for speed
174 virtual bool clipRect(const SkRect& rect, SkRegion::Op op, 174 virtual bool clipRect(const SkRect& rect, SkRegion::Op op,
175 bool doAA) SK_OVERRIDE { 175 bool doAA) SK_OVERRIDE {
176 return this->INHERITED::clipRect(rect, op, false); 176 return this->INHERITED::clipRect(rect, op, false);
177 } 177 }
178 178
179 // for speed, just respect the bounds, and disable AA. May give us a few 179 // for speed, just respect the bounds, and disable AA. May give us a few
180 // false positives and negatives. 180 // false positives and negatives.
181 virtual bool clipPath(const SkPath& path, SkRegion::Op op, 181 virtual bool clipPath(const SkPath& path, SkRegion::Op op,
182 bool doAA) SK_OVERRIDE { 182 bool doAA) SK_OVERRIDE {
183 return this->INHERITED::clipRect(path.getBounds(), op, false); 183 return this->updateClipConservativelyUsingBounds(path.getBounds(), op, p ath.isInverseFillType());
184 } 184 }
185 virtual bool clipRRect(const SkRRect& rrect, SkRegion::Op op, 185 virtual bool clipRRect(const SkRRect& rrect, SkRegion::Op op,
186 bool doAA) SK_OVERRIDE { 186 bool doAA) SK_OVERRIDE {
187 return this->INHERITED::clipRect(rrect.getBounds(), op, false); 187 return this->updateClipConservativelyUsingBounds(rrect.getBounds(), op, false);
188 } 188 }
189 189
190 private: 190 private:
191 typedef SkCanvas INHERITED; 191 typedef SkCanvas INHERITED;
192 }; 192 };
193 193
194 SkData* SkPictureUtils::GatherPixelRefs(SkPicture* pict, const SkRect& area) { 194 SkData* SkPictureUtils::GatherPixelRefs(SkPicture* pict, const SkRect& area) {
195 if (NULL == pict) { 195 if (NULL == pict) {
196 return NULL; 196 return NULL;
197 } 197 }
(...skipping 18 matching lines...) Expand all
216 canvas.clipRect(area, SkRegion::kIntersect_Op, false); 216 canvas.clipRect(area, SkRegion::kIntersect_Op, false);
217 canvas.drawPicture(*pict); 217 canvas.drawPicture(*pict);
218 218
219 SkData* data = NULL; 219 SkData* data = NULL;
220 int count = array.count(); 220 int count = array.count();
221 if (count > 0) { 221 if (count > 0) {
222 data = SkData::NewFromMalloc(array.detach(), count * sizeof(SkPixelRef*) ); 222 data = SkData::NewFromMalloc(array.detach(), count * sizeof(SkPixelRef*) );
223 } 223 }
224 return data; 224 return data;
225 } 225 }
OLDNEW
« src/core/SkCanvas.cpp ('K') | « src/core/SkPictureRecord.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698