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

Side by Side Diff: src/effects/gradients/SkTwoPointConicalGradient.cpp

Issue 12879005: Fixing deferred canvas bug caused by SkTwoPointConicalGradient declaring itself as opaque. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 9 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 | « src/effects/gradients/SkTwoPointConicalGradient.h ('k') | tests/DeferredCanvasTest.cpp » ('j') | 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 2012 Google Inc. 3 * Copyright 2012 Google Inc.
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 #include "SkTwoPointConicalGradient.h" 9 #include "SkTwoPointConicalGradient.h"
10 10
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 : SkGradientShaderBase(colors, pos, colorCount, mode, mapper), 183 : SkGradientShaderBase(colors, pos, colorCount, mode, mapper),
184 fCenter1(start), 184 fCenter1(start),
185 fCenter2(end), 185 fCenter2(end),
186 fRadius1(startRadius), 186 fRadius1(startRadius),
187 fRadius2(endRadius) { 187 fRadius2(endRadius) {
188 // this is degenerate, and should be caught by our caller 188 // this is degenerate, and should be caught by our caller
189 SkASSERT(fCenter1 != fCenter2 || fRadius1 != fRadius2); 189 SkASSERT(fCenter1 != fCenter2 || fRadius1 != fRadius2);
190 this->init(); 190 this->init();
191 } 191 }
192 192
193 bool SkTwoPointConicalGradient::isOpaque() const {
194 // Because areas outside the cone are left untouched, we cannot treat the
195 // shader as opaque even if the gradient itself is opaque.
196 return false;
197 }
198
193 void SkTwoPointConicalGradient::shadeSpan(int x, int y, SkPMColor* dstCParam, 199 void SkTwoPointConicalGradient::shadeSpan(int x, int y, SkPMColor* dstCParam,
194 int count) { 200 int count) {
195 int toggle = init_dither_toggle(x, y); 201 int toggle = init_dither_toggle(x, y);
196 202
197 SkASSERT(count > 0); 203 SkASSERT(count > 0);
198 204
199 SkPMColor* SK_RESTRICT dstC = dstCParam; 205 SkPMColor* SK_RESTRICT dstC = dstCParam;
200 206
201 SkMatrix::MapXYProc dstProc = fDstToIndexProc; 207 SkMatrix::MapXYProc dstProc = fDstToIndexProc;
202 208
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after
751 str->appendScalar(fCenter2.fY); 757 str->appendScalar(fCenter2.fY);
752 str->append(") radius2: "); 758 str->append(") radius2: ");
753 str->appendScalar(fRadius2); 759 str->appendScalar(fRadius2);
754 str->append(" "); 760 str->append(" ");
755 761
756 this->INHERITED::toString(str); 762 this->INHERITED::toString(str);
757 763
758 str->append(")"); 764 str->append(")");
759 } 765 }
760 #endif 766 #endif
OLDNEW
« no previous file with comments | « src/effects/gradients/SkTwoPointConicalGradient.h ('k') | tests/DeferredCanvasTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698