Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / skia / src / gpu / GrPaint.cpp
index 7499cd0..328484b 100644 (file)
 #include "effects/GrSimpleTextureEffect.h"
 
 void GrPaint::addColorTextureEffect(GrTexture* texture, const SkMatrix& matrix) {
-    GrEffectRef* effect = GrSimpleTextureEffect::Create(texture, matrix);
-    this->addColorEffect(effect)->unref();
+    this->addColorEffect(GrSimpleTextureEffect::Create(texture, matrix))->unref();
 }
 
 void GrPaint::addCoverageTextureEffect(GrTexture* texture, const SkMatrix& matrix) {
-    GrEffectRef* effect = GrSimpleTextureEffect::Create(texture, matrix);
-    this->addCoverageEffect(effect)->unref();
+    this->addCoverageEffect(GrSimpleTextureEffect::Create(texture, matrix))->unref();
 }
 
 void GrPaint::addColorTextureEffect(GrTexture* texture,
                                     const SkMatrix& matrix,
                                     const GrTextureParams& params) {
-    GrEffectRef* effect = GrSimpleTextureEffect::Create(texture, matrix, params);
-    this->addColorEffect(effect)->unref();
+    this->addColorEffect(GrSimpleTextureEffect::Create(texture, matrix, params))->unref();
 }
 
 void GrPaint::addCoverageTextureEffect(GrTexture* texture,
                                        const SkMatrix& matrix,
                                        const GrTextureParams& params) {
-    GrEffectRef* effect = GrSimpleTextureEffect::Create(texture, matrix, params);
-    this->addCoverageEffect(effect)->unref();
+    this->addCoverageEffect(GrSimpleTextureEffect::Create(texture, matrix, params))->unref();
 }
 
 bool GrPaint::isOpaque() const {
@@ -60,7 +56,7 @@ bool GrPaint::getOpaqueAndKnownColor(GrColor* solidColor,
     uint32_t coverageComps = kRGBA_GrColorComponentFlags;
     int count = fCoverageStages.count();
     for (int i = 0; i < count; ++i) {
-        (*fCoverageStages[i].getEffect())->getConstantColorComponents(&coverage, &coverageComps);
+        fCoverageStages[i].getEffect()->getConstantColorComponents(&coverage, &coverageComps);
     }
     if (kRGBA_GrColorComponentFlags != coverageComps || 0xffffffff != coverage) {
         return false;
@@ -70,7 +66,7 @@ bool GrPaint::getOpaqueAndKnownColor(GrColor* solidColor,
     uint32_t colorComps = kRGBA_GrColorComponentFlags;
     count = fColorStages.count();
     for (int i = 0; i < count; ++i) {
-        (*fColorStages[i].getEffect())->getConstantColorComponents(&color, &colorComps);
+        fColorStages[i].getEffect()->getConstantColorComponents(&color, &colorComps);
     }
 
     SkASSERT((NULL == solidColor) == (NULL == solidColorKnownComponents));
@@ -104,7 +100,7 @@ bool GrPaint::getOpaqueAndKnownColor(GrColor* solidColor,
                 case kDA_GrBlendCoeff:
                 case kIDA_GrBlendCoeff:
                 default:
-                    GrCrash("srcCoeff should not refer to src or dst.");
+                    SkFAIL("srcCoeff should not refer to src or dst.");
                     break;
 
                 // TODO: update this once GrPaint actually has a const color.