| OLD | NEW |
| 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 Loading... |
| 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 layerPaint.setImageFilter(paint->getImageFilter()->makeWithLocalMatrix(i
nvCtm)); |
| 927 layerPaint.setImageFilter(localFilter); | |
| 928 c->saveLayer(&bounds, &layerPaint); | 927 c->saveLayer(&bounds, &layerPaint); |
| 929 imagePaint.setXfermodeMode(SkXfermode::kSrcOver_Mode); | 928 imagePaint.setXfermodeMode(SkXfermode::kSrcOver_Mode); |
| 930 imagePaint.setImageFilter(nullptr); | 929 imagePaint.setImageFilter(nullptr); |
| 931 } | 930 } |
| 932 | 931 |
| 933 if (!imageSource->isVideoElement()) { | 932 if (!imageSource->isVideoElement()) { |
| 934 imagePaint.setAntiAlias(shouldDrawImageAntialiased(dstRect)); | 933 imagePaint.setAntiAlias(shouldDrawImageAntialiased(dstRect)); |
| 935 image->draw(c, imagePaint, dstRect, srcRect, DoNotRespectImageOrientatio
n, Image::DoNotClampImageToSourceRect); | 934 image->draw(c, imagePaint, dstRect, srcRect, DoNotRespectImageOrientatio
n, Image::DoNotClampImageToSourceRect); |
| 936 } else { | 935 } else { |
| 937 c->save(); | 936 c->save(); |
| (...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1374 | 1373 |
| 1375 imageBuffer()->willOverwriteCanvas(); | 1374 imageBuffer()->willOverwriteCanvas(); |
| 1376 } | 1375 } |
| 1377 | 1376 |
| 1378 DEFINE_TRACE(BaseRenderingContext2D) | 1377 DEFINE_TRACE(BaseRenderingContext2D) |
| 1379 { | 1378 { |
| 1380 visitor->trace(m_stateStack); | 1379 visitor->trace(m_stateStack); |
| 1381 } | 1380 } |
| 1382 | 1381 |
| 1383 } // namespace blink | 1382 } // namespace blink |
| OLD | NEW |