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

Unified Diff: src/effects/gradients/SkLinearGradient.cpp

Issue 264843006: create struct to hold all the params passed around for shader::context (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: address review comments Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/effects/gradients/SkLinearGradient.h ('k') | src/effects/gradients/SkRadialGradient.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/gradients/SkLinearGradient.cpp
diff --git a/src/effects/gradients/SkLinearGradient.cpp b/src/effects/gradients/SkLinearGradient.cpp
index 70bbbf3b601e7caa070642a41b84a749ada036d7..b9de651fcecac83bc6876cd03d5bbe1a2ac5cd80 100644
--- a/src/effects/gradients/SkLinearGradient.cpp
+++ b/src/effects/gradients/SkLinearGradient.cpp
@@ -76,24 +76,22 @@ size_t SkLinearGradient::contextSize() const {
return sizeof(LinearGradientContext);
}
-SkShader::Context* SkLinearGradient::createContext(const SkBitmap& device, const SkPaint& paint,
- const SkMatrix& matrix, void* storage) const {
- if (!this->validContext(device, paint, matrix)) {
+SkShader::Context* SkLinearGradient::createContext(const ContextRec& rec, void* storage) const {
+ if (!this->validContext(rec)) {
return NULL;
}
- return SkNEW_PLACEMENT_ARGS(storage, LinearGradientContext, (*this, device, paint, matrix));
+ return SkNEW_PLACEMENT_ARGS(storage, LinearGradientContext, (*this, rec));
}
SkLinearGradient::LinearGradientContext::LinearGradientContext(
- const SkLinearGradient& shader, const SkBitmap& device,
- const SkPaint& paint, const SkMatrix& matrix)
- : INHERITED(shader, device, paint, matrix)
+ const SkLinearGradient& shader, const ContextRec& rec)
+ : INHERITED(shader, rec)
{
unsigned mask = SkMatrix::kTranslate_Mask | SkMatrix::kScale_Mask;
if ((fDstToIndex.getType() & ~mask) == 0) {
// when we dither, we are (usually) not const-in-Y
- if ((fFlags & SkShader::kHasSpan16_Flag) && !paint.isDither()) {
+ if ((fFlags & SkShader::kHasSpan16_Flag) && !rec.fPaint->isDither()) {
// only claim this if we do have a 16bit mode (i.e. none of our
// colors have alpha), and if we are not dithering (which obviously
// is not const in Y).
« no previous file with comments | « src/effects/gradients/SkLinearGradient.h ('k') | src/effects/gradients/SkRadialGradient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698