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

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

Issue 1849213002: Remove SK_SUPPORT_LEGACY_XFERMODE_PTR (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adopt the pointer but don't ref it Created 4 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 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 "bindings/core/v8/ExceptionStatePlaceholder.h" 9 #include "bindings/core/v8/ExceptionStatePlaceholder.h"
10 #include "core/css/parser/CSSParser.h" 10 #include "core/css/parser/CSSParser.h"
(...skipping 904 matching lines...) Expand 10 before | Expand all | Expand 10 after
915 SkMatrix invCtm; 915 SkMatrix invCtm;
916 if (!c->getTotalMatrix().invert(&invCtm)) { 916 if (!c->getTotalMatrix().invert(&invCtm)) {
917 // There is an earlier check for invertibility, but the arithmetic 917 // There is an earlier check for invertibility, but the arithmetic
918 // in AffineTransform is not exactly identical, so it is possible 918 // in AffineTransform is not exactly identical, so it is possible
919 // for SkMatrix to find the transform to be non-invertible at this s tage. 919 // for SkMatrix to find the transform to be non-invertible at this s tage.
920 // crbug.com/504687 920 // crbug.com/504687
921 return; 921 return;
922 } 922 }
923 SkRect bounds = dstRect; 923 SkRect bounds = dstRect;
924 SkPaint layerPaint; 924 SkPaint layerPaint;
925 layerPaint.setXfermode(paint->getXfermode()); 925 layerPaint.setXfermode(sk_ref_sp(paint->getXfermode()));
926 SkAutoTUnref<SkImageFilter> localFilter(paint->getImageFilter()->newWith LocalMatrix(invCtm)); 926 sk_sp<SkImageFilter> localFilter(paint->getImageFilter()->makeWithLocalM atrix(invCtm));
927 layerPaint.setImageFilter(localFilter); 927 layerPaint.setImageFilter(localFilter);
f(malita) 2016/04/01 18:16:00 std::move or inline.
928 c->saveLayer(&bounds, &layerPaint); 928 c->saveLayer(&bounds, &layerPaint);
929 imagePaint.setXfermodeMode(SkXfermode::kSrcOver_Mode); 929 imagePaint.setXfermodeMode(SkXfermode::kSrcOver_Mode);
930 imagePaint.setImageFilter(nullptr); 930 imagePaint.setImageFilter(nullptr);
931 } 931 }
932 932
933 if (!imageSource->isVideoElement()) { 933 if (!imageSource->isVideoElement()) {
934 imagePaint.setAntiAlias(shouldDrawImageAntialiased(dstRect)); 934 imagePaint.setAntiAlias(shouldDrawImageAntialiased(dstRect));
935 image->draw(c, imagePaint, dstRect, srcRect, DoNotRespectImageOrientatio n, Image::DoNotClampImageToSourceRect); 935 image->draw(c, imagePaint, dstRect, srcRect, DoNotRespectImageOrientatio n, Image::DoNotClampImageToSourceRect);
936 } else { 936 } else {
937 c->save(); 937 c->save();
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
1374 1374
1375 imageBuffer()->willOverwriteCanvas(); 1375 imageBuffer()->willOverwriteCanvas();
1376 } 1376 }
1377 1377
1378 DEFINE_TRACE(BaseRenderingContext2D) 1378 DEFINE_TRACE(BaseRenderingContext2D)
1379 { 1379 {
1380 visitor->trace(m_stateStack); 1380 visitor->trace(m_stateStack);
1381 } 1381 }
1382 1382
1383 } // namespace blink 1383 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698