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

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

Issue 2157953002: Change filter quality when scaling-down in drawImage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 956 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698