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 956 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
967 layerPaint.setImageFilter(paint->getImageFilter()); | 967 layerPaint.setImageFilter(paint->getImageFilter()); |
968 | 968 |
969 c->saveLayer(&bounds, &layerPaint); | 969 c->saveLayer(&bounds, &layerPaint); |
970 c->concat(ctm); | 970 c->concat(ctm); |
971 imagePaint.setXfermodeMode(SkXfermode::kSrcOver_Mode); | 971 imagePaint.setXfermodeMode(SkXfermode::kSrcOver_Mode); |
972 imagePaint.setImageFilter(nullptr); | 972 imagePaint.setImageFilter(nullptr); |
973 } | 973 } |
974 | 974 |
975 if (!imageSource->isVideoElement()) { | 975 if (!imageSource->isVideoElement()) { |
976 imagePaint.setAntiAlias(shouldDrawImageAntialiased(dstRect)); | 976 imagePaint.setAntiAlias(shouldDrawImageAntialiased(dstRect)); |
977 image->draw(c, imagePaint, dstRect, srcRect, DoNotRespectImageOrientatio
n, Image::DoNotClampImageToSourceRect); | 977 image->draw(c, imagePaint, dstRect, srcRect, imageSmoothingEnabled(), Do
NotRespectImageOrientation, Image::DoNotClampImageToSourceRect); |
978 } else { | 978 } else { |
979 c->save(); | 979 c->save(); |
980 c->clipRect(dstRect); | 980 c->clipRect(dstRect); |
981 c->translate(dstRect.x(), dstRect.y()); | 981 c->translate(dstRect.x(), dstRect.y()); |
982 c->scale(dstRect.width() / srcRect.width(), dstRect.height() / srcRect.h
eight()); | 982 c->scale(dstRect.width() / srcRect.width(), dstRect.height() / srcRect.h
eight()); |
983 c->translate(-srcRect.x(), -srcRect.y()); | 983 c->translate(-srcRect.x(), -srcRect.y()); |
984 HTMLVideoElement* video = static_cast<HTMLVideoElement*>(imageSource); | 984 HTMLVideoElement* video = static_cast<HTMLVideoElement*>(imageSource); |
985 video->paintCurrentFrame(c, IntRect(IntPoint(), IntSize(video->videoWidt
h(), video->videoHeight())), &imagePaint); | 985 video->paintCurrentFrame(c, IntRect(IntPoint(), IntSize(video->videoWidt
h(), video->videoHeight())), &imagePaint); |
986 } | 986 } |
987 | 987 |
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1579 numPatterns(0), | 1579 numPatterns(0), |
1580 numDrawWithComplexClips(0), | 1580 numDrawWithComplexClips(0), |
1581 numBlurredShadows(0), | 1581 numBlurredShadows(0), |
1582 numFilters(0), | 1582 numFilters(0), |
1583 numGetImageDataCalls(0), | 1583 numGetImageDataCalls(0), |
1584 numPutImageDataCalls(0), | 1584 numPutImageDataCalls(0), |
1585 numClearRectCalls(0), | 1585 numClearRectCalls(0), |
1586 numDrawFocusCalls(0) {} | 1586 numDrawFocusCalls(0) {} |
1587 | 1587 |
1588 } // namespace blink | 1588 } // namespace blink |
OLD | NEW |