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

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: 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 if (object->style()->imageRendering() == ImageRenderingPixelated) {
pdr. 2014/06/13 03:21:14 Nit: no need for the curly braces.
jackhou 2014/06/13 03:33:19 Done.
66 return InterpolationNone;
67 }
68
65 if (InterpolationDefault == InterpolationLow) 69 if (InterpolationDefault == InterpolationLow)
66 return InterpolationLow; 70 return InterpolationLow;
67 71
68 if (shouldPaintAtLowQuality(context, object, image, layer, layoutSize)) 72 if (shouldPaintAtLowQuality(context, object, image, layer, layoutSize))
69 return InterpolationLow; 73 return InterpolationLow;
70 74
71 // For images that are potentially animated we paint them at medium quality. 75 // For images that are potentially animated we paint them at medium quality.
72 if (image && image->maybeAnimated()) 76 if (image && image->maybeAnimated())
73 return InterpolationMedium; 77 return InterpolationMedium;
74 78
(...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 225 // 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 226 // is active, so draw at low quality, set the flag for animated resizes and
223 // the object to the list for high quality redraw. 227 // the object to the list for high quality redraw.
224 set(object, innerMap, layer, scaledLayoutSize); 228 set(object, innerMap, layer, scaledLayoutSize);
225 m_animatedResizeIsActive = true; 229 m_animatedResizeIsActive = true;
226 restartTimer(); 230 restartTimer();
227 return true; 231 return true;
228 } 232 }
229 233
230 } // namespace WebCore 234 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698