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

Side by Side Diff: third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp

Issue 2625403002: Prefer newly added SkPaint::refFoo() over getFoo() (Closed)
Patch Set: inline SkComposeImageFilter construction Created 3 years, 11 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "modules/canvas2d/BaseRenderingContext2D.h" 5 #include "modules/canvas2d/BaseRenderingContext2D.h"
6 6
7 #include "bindings/core/v8/ExceptionMessages.h" 7 #include "bindings/core/v8/ExceptionMessages.h"
8 #include "bindings/core/v8/ExceptionState.h" 8 #include "bindings/core/v8/ExceptionState.h"
9 #include "core/css/cssom/CSSURLImageValue.h" 9 #include "core/css/cssom/CSSURLImageValue.h"
10 #include "core/css/parser/CSSParser.h" 10 #include "core/css/parser/CSSParser.h"
(...skipping 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after
1056 // for SkMatrix to find the transform to be non-invertible at this stage. 1056 // for SkMatrix to find the transform to be non-invertible at this stage.
1057 // crbug.com/504687 1057 // crbug.com/504687
1058 return; 1058 return;
1059 } 1059 }
1060 c->save(); 1060 c->save();
1061 c->concat(invCtm); 1061 c->concat(invCtm);
1062 SkRect bounds = dstRect; 1062 SkRect bounds = dstRect;
1063 ctm.mapRect(&bounds); 1063 ctm.mapRect(&bounds);
1064 SkPaint layerPaint; 1064 SkPaint layerPaint;
1065 layerPaint.setBlendMode(paint->getBlendMode()); 1065 layerPaint.setBlendMode(paint->getBlendMode());
1066 layerPaint.setImageFilter(sk_ref_sp(paint->getImageFilter())); 1066 layerPaint.setImageFilter(paint->refImageFilter());
1067 1067
1068 c->saveLayer(&bounds, &layerPaint); 1068 c->saveLayer(&bounds, &layerPaint);
1069 c->concat(ctm); 1069 c->concat(ctm);
1070 imagePaint.setBlendMode(SkBlendMode::kSrcOver); 1070 imagePaint.setBlendMode(SkBlendMode::kSrcOver);
1071 imagePaint.setImageFilter(nullptr); 1071 imagePaint.setImageFilter(nullptr);
1072 } 1072 }
1073 1073
1074 if (!imageSmoothingEnabled() && 1074 if (!imageSmoothingEnabled() &&
1075 isDrawScalingDown(srcRect, dstRect, state().transform().xScaleSquared(), 1075 isDrawScalingDown(srcRect, dstRect, state().transform().xScaleSquared(),
1076 state().transform().yScaleSquared())) 1076 state().transform().yScaleSquared()))
(...skipping 936 matching lines...) Expand 10 before | Expand all | Expand 10 after
2013 ExpensiveCanvasHeuristicParameters::ShadowFixedCost[index] * 2013 ExpensiveCanvasHeuristicParameters::ShadowFixedCost[index] *
2014 m_usageCounters.numBlurredShadows + 2014 m_usageCounters.numBlurredShadows +
2015 ExpensiveCanvasHeuristicParameters:: 2015 ExpensiveCanvasHeuristicParameters::
2016 ShadowVariableCostPerAreaTimesShadowBlurSquared[index] * 2016 ShadowVariableCostPerAreaTimesShadowBlurSquared[index] *
2017 m_usageCounters.boundingBoxAreaTimesShadowBlurSquared; 2017 m_usageCounters.boundingBoxAreaTimesShadowBlurSquared;
2018 2018
2019 return basicCostOfDrawCalls + fillTypeAdjustment + shadowAdjustment; 2019 return basicCostOfDrawCalls + fillTypeAdjustment + shadowAdjustment;
2020 } 2020 }
2021 2021
2022 } // namespace blink 2022 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698