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

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

Issue 1759653004: enforce 16byte alignment in shader contexts (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 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
« no previous file with comments | « src/effects/gradients/SkTwoPointConicalGradient.h ('k') | src/image/SkImageShader.h » ('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 * 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 "SkTwoPointConicalGradient.h" 8 #include "SkTwoPointConicalGradient.h"
9 #include "SkTwoPointConicalGradient_gpu.h" 9 #include "SkTwoPointConicalGradient_gpu.h"
10 10
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 fRec.init(fCenter1, fRadius1, fCenter2, fRadius2, fFlippedGrad); 204 fRec.init(fCenter1, fRadius1, fCenter2, fRadius2, fFlippedGrad);
205 } 205 }
206 206
207 bool SkTwoPointConicalGradient::isOpaque() const { 207 bool SkTwoPointConicalGradient::isOpaque() const {
208 // Because areas outside the cone are left untouched, we cannot treat the 208 // Because areas outside the cone are left untouched, we cannot treat the
209 // shader as opaque even if the gradient itself is opaque. 209 // shader as opaque even if the gradient itself is opaque.
210 // TODO(junov): Compute whether the cone fills the plane crbug.com/222380 210 // TODO(junov): Compute whether the cone fills the plane crbug.com/222380
211 return false; 211 return false;
212 } 212 }
213 213
214 size_t SkTwoPointConicalGradient::contextSize(const ContextRec&) const { 214 size_t SkTwoPointConicalGradient::onContextSize(const ContextRec&) const {
215 return sizeof(TwoPointConicalGradientContext); 215 return SkAlign16(sizeof(TwoPointConicalGradientContext));
216 } 216 }
217 217
218 SkShader::Context* SkTwoPointConicalGradient::onCreateContext(const ContextRec& rec, 218 SkShader::Context* SkTwoPointConicalGradient::onCreateContext(const ContextRec& rec,
219 void* storage) con st { 219 void* storage) con st {
220 return new (storage) TwoPointConicalGradientContext(*this, rec); 220 return new (storage) TwoPointConicalGradientContext(*this, rec);
221 } 221 }
222 222
223 SkTwoPointConicalGradient::TwoPointConicalGradientContext::TwoPointConicalGradie ntContext( 223 SkTwoPointConicalGradient::TwoPointConicalGradientContext::TwoPointConicalGradie ntContext(
224 const SkTwoPointConicalGradient& shader, const ContextRec& rec) 224 const SkTwoPointConicalGradient& shader, const ContextRec& rec)
225 : INHERITED(shader, rec) 225 : INHERITED(shader, rec)
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 str->appendScalar(fCenter2.fY); 388 str->appendScalar(fCenter2.fY);
389 str->append(") radius2: "); 389 str->append(") radius2: ");
390 str->appendScalar(fRadius2); 390 str->appendScalar(fRadius2);
391 str->append(" "); 391 str->append(" ");
392 392
393 this->INHERITED::toString(str); 393 this->INHERITED::toString(str);
394 394
395 str->append(")"); 395 str->append(")");
396 } 396 }
397 #endif 397 #endif
OLDNEW
« no previous file with comments | « src/effects/gradients/SkTwoPointConicalGradient.h ('k') | src/image/SkImageShader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698