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

Side by Side Diff: Source/platform/graphics/GraphicsContext.cpp

Issue 1179143003: SP: antialias images regardless of CTM. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/platform/graphics/GraphicsContext.h ('k') | Source/platform/graphics/Image.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2003, 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2004, 2005, 2006, 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2013 Google Inc. All rights reserved. 3 * Copyright (C) 2013 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 926 matching lines...) Expand 10 before | Expand all | Expand 10 after
937 return; 937 return;
938 938
939 SkPaint imagePaint = immutableState()->fillPaint(); 939 SkPaint imagePaint = immutableState()->fillPaint();
940 imagePaint.setXfermodeMode(op); 940 imagePaint.setXfermodeMode(op);
941 imagePaint.setColor(SK_ColorBLACK); 941 imagePaint.setColor(SK_ColorBLACK);
942 imagePaint.setFilterQuality(computeFilterQuality(image, dest, src)); 942 imagePaint.setFilterQuality(computeFilterQuality(image, dest, src));
943 // Disable anti-aliasing if we're not rotated or skewed. 943 // Disable anti-aliasing if we're not rotated or skewed.
944 // TODO(junov): crbug.com/492187 This code will disable antialiasing 944 // TODO(junov): crbug.com/492187 This code will disable antialiasing
945 // regardless of whether content is pixel aligned. Is this correct? 945 // regardless of whether content is pixel aligned. Is this correct?
946 // For now, just preserving legacy behavior. 946 // For now, just preserving legacy behavior.
947 imagePaint.setAntiAlias(shouldAntialiasImages()); 947 imagePaint.setAntiAlias(shouldAntialias());
948 image->draw(m_canvas, imagePaint, dest, src, shouldRespectImageOrientation, Image::ClampImageToSourceRect); 948 image->draw(m_canvas, imagePaint, dest, src, shouldRespectImageOrientation, Image::ClampImageToSourceRect);
949 } 949 }
950 950
951 SkFilterQuality GraphicsContext::computeFilterQuality(Image* image, const FloatR ect& dest, const FloatRect& src) const 951 SkFilterQuality GraphicsContext::computeFilterQuality(Image* image, const FloatR ect& dest, const FloatRect& src) const
952 { 952 {
953 InterpolationQuality resampling; 953 InterpolationQuality resampling;
954 if (printing()) { 954 if (printing()) {
955 resampling = InterpolationNone; 955 resampling = InterpolationNone;
956 } else if (image->isLazyDecodedBitmap()) { 956 } else if (image->isLazyDecodedBitmap()) {
957 resampling = InterpolationHigh; 957 resampling = InterpolationHigh;
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after
1569 static const SkPMColor colors[] = { 1569 static const SkPMColor colors[] = {
1570 SkPreMultiplyARGB(0x60, 0xFF, 0x00, 0x00), // More transparent red 1570 SkPreMultiplyARGB(0x60, 0xFF, 0x00, 0x00), // More transparent red
1571 SkPreMultiplyARGB(0x60, 0xC0, 0xC0, 0xC0) // More transparent gray 1571 SkPreMultiplyARGB(0x60, 0xC0, 0xC0, 0xC0) // More transparent gray
1572 }; 1572 };
1573 1573
1574 return colors[index]; 1574 return colors[index];
1575 } 1575 }
1576 #endif 1576 #endif
1577 1577
1578 } // namespace blink 1578 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/graphics/GraphicsContext.h ('k') | Source/platform/graphics/Image.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698