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

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

Issue 16305002: Hamfisted fix to drawLooper w/ 0 stages bug (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
« no previous file with comments | « no previous file | 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 2013 Google Inc. 2 * Copyright 2013 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 "SkDrawLooper.h" 8 #include "SkDrawLooper.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkMatrix.h" 10 #include "SkMatrix.h"
(...skipping 17 matching lines...) Expand all
28 break; 28 break;
29 } 29 }
30 } 30 }
31 return true; 31 return true;
32 } 32 }
33 33
34 void SkDrawLooper::computeFastBounds(const SkPaint& paint, const SkRect& src, 34 void SkDrawLooper::computeFastBounds(const SkPaint& paint, const SkRect& src,
35 SkRect* dst) { 35 SkRect* dst) {
36 SkCanvas canvas; 36 SkCanvas canvas;
37 37
38 *dst = src;
38 this->init(&canvas); 39 this->init(&canvas);
39 for (bool firstTime = true;; firstTime = false) { 40 for (bool firstTime = true;; firstTime = false) {
40 SkPaint p(paint); 41 SkPaint p(paint);
41 if (this->next(&canvas, &p)) { 42 if (this->next(&canvas, &p)) {
42 SkRect r(src); 43 SkRect r(src);
43 44
44 p.setLooper(NULL); 45 p.setLooper(NULL);
45 p.computeFastBounds(r, &r); 46 p.computeFastBounds(r, &r);
46 canvas.getTotalMatrix().mapRect(&r); 47 canvas.getTotalMatrix().mapRect(&r);
47 48
48 if (firstTime) { 49 if (firstTime) {
49 *dst = r; 50 *dst = r;
50 } else { 51 } else {
51 dst->join(r); 52 dst->join(r);
52 } 53 }
53 } else { 54 } else {
54 break; 55 break;
55 } 56 }
56 } 57 }
57 } 58 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698