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

Side by Side Diff: Source/core/rendering/ImageQualityController.cpp

Issue 336693005: Add image-rendering: pixelated. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Don't add 'pixelated' to devtools. Created 6 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 gImageQualityController->objectDestroyed(renderer); 55 gImageQualityController->objectDestroyed(renderer);
56 if (gImageQualityController->isEmpty()) { 56 if (gImageQualityController->isEmpty()) {
57 delete gImageQualityController; 57 delete gImageQualityController;
58 gImageQualityController = 0; 58 gImageQualityController = 0;
59 } 59 }
60 } 60 }
61 } 61 }
62 62
63 InterpolationQuality ImageQualityController::chooseInterpolationQuality(Graphics Context* context, RenderObject* object, Image* image, const void* layer, const L ayoutSize& layoutSize) 63 InterpolationQuality ImageQualityController::chooseInterpolationQuality(Graphics Context* context, RenderObject* object, Image* image, const void* layer, const L ayoutSize& layoutSize)
64 { 64 {
65 // FIXME: This ImageRenderingPixelated should only be InterpolationNone when
66 // upscaling. It should be the same as ImageRenderingAuto when downscaling.
67 // See crbug.com/386944.
68 if (object->style()->imageRendering() == ImageRenderingPixelated)
69 return InterpolationNone;
70
65 if (InterpolationDefault == InterpolationLow) 71 if (InterpolationDefault == InterpolationLow)
66 return InterpolationLow; 72 return InterpolationLow;
67 73
68 if (shouldPaintAtLowQuality(context, object, image, layer, layoutSize)) 74 if (shouldPaintAtLowQuality(context, object, image, layer, layoutSize))
69 return InterpolationLow; 75 return InterpolationLow;
70 76
71 // For images that are potentially animated we paint them at medium quality. 77 // For images that are potentially animated we paint them at medium quality.
72 if (image && image->maybeAnimated()) 78 if (image && image->maybeAnimated())
73 return InterpolationMedium; 79 return InterpolationMedium;
74 80
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 // This object has been resized to two different sizes while the timer 227 // This object has been resized to two different sizes while the timer
222 // is active, so draw at low quality, set the flag for animated resizes and 228 // is active, so draw at low quality, set the flag for animated resizes and
223 // the object to the list for high quality redraw. 229 // the object to the list for high quality redraw.
224 set(object, innerMap, layer, scaledLayoutSize); 230 set(object, innerMap, layer, scaledLayoutSize);
225 m_animatedResizeIsActive = true; 231 m_animatedResizeIsActive = true;
226 restartTimer(); 232 restartTimer();
227 return true; 233 return true;
228 } 234 }
229 235
230 } // namespace WebCore 236 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/css/parser/CSSPropertyParser.cpp ('k') | Source/core/rendering/RenderHTMLCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698