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

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

Issue 2397473003: Harden degenerate gradient context handling (Closed)
Patch Set: Created 4 years, 2 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/SkGradientShaderPriv.h ('k') | src/effects/gradients/SkRadialGradient.cpp » ('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 be29540add6abf78c9469af23e996b3f396f18d7..a249ae4ac82c2195ce2e559978cf057ce0a8377a 100644
--- a/src/effects/gradients/SkLinearGradient.cpp
+++ b/src/effects/gradients/SkLinearGradient.cpp
@@ -82,8 +82,8 @@ size_t SkLinearGradient::onContextSize(const ContextRec& rec) const {
SkShader::Context* SkLinearGradient::onCreateContext(const ContextRec& rec, void* storage) const {
return use_4f_context(rec, fGradFlags)
- ? static_cast<SkShader::Context*>(new (storage) LinearGradient4fContext(*this, rec))
- : static_cast<SkShader::Context*>(new (storage) LinearGradientContext(*this, rec));
+ ? CheckedCreateContext<LinearGradient4fContext>(storage, *this, rec)
+ : CheckedCreateContext< LinearGradientContext>(storage, *this, rec);
}
// This swizzles SkColor into the same component order as SkPMColor, but does not actually
« no previous file with comments | « src/effects/gradients/SkGradientShaderPriv.h ('k') | src/effects/gradients/SkRadialGradient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698