Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2006, 2007 Apple 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 66 LayoutRect paintRect = replacedContentRect(); | 66 LayoutRect paintRect = replacedContentRect(); |
| 67 paintRect.moveBy(paintOffset); | 67 paintRect.moveBy(paintOffset); |
| 68 | 68 |
| 69 bool clip = !contentRect.contains(paintRect); | 69 bool clip = !contentRect.contains(paintRect); |
| 70 if (clip) { | 70 if (clip) { |
| 71 // Not allowed to overflow the content box. | 71 // Not allowed to overflow the content box. |
| 72 paintInfo.context->save(); | 72 paintInfo.context->save(); |
| 73 paintInfo.context->clip(pixelSnappedIntRect(contentRect)); | 73 paintInfo.context->clip(pixelSnappedIntRect(contentRect)); |
| 74 } | 74 } |
| 75 | 75 |
| 76 // FIXME: InterpolationNone should be used if ImageRenderingOptimizeContrast is set. | |
|
Stephen White
2014/03/18 17:26:43
Please log a bug for this, if there isn't one alre
Alpha Left Google
2014/03/18 22:59:13
Done.
| |
| 76 bool useLowQualityScale = style()->imageRendering() == ImageRenderingOptimiz eContrast; | 77 bool useLowQualityScale = style()->imageRendering() == ImageRenderingOptimiz eContrast; |
| 77 toHTMLCanvasElement(node())->paint(context, paintRect, useLowQualityScale); | 78 toHTMLCanvasElement(node())->paint(context, paintRect, useLowQualityScale ? InterpolationLow : DefaultInterpolationQuality); |
| 78 | 79 |
| 79 if (clip) | 80 if (clip) |
| 80 context->restore(); | 81 context->restore(); |
| 81 } | 82 } |
| 82 | 83 |
| 83 void RenderHTMLCanvas::canvasSizeChanged() | 84 void RenderHTMLCanvas::canvasSizeChanged() |
| 84 { | 85 { |
| 85 IntSize canvasSize = toHTMLCanvasElement(node())->size(); | 86 IntSize canvasSize = toHTMLCanvasElement(node())->size(); |
| 86 LayoutSize zoomedSize(canvasSize.width() * style()->effectiveZoom(), canvasS ize.height() * style()->effectiveZoom()); | 87 LayoutSize zoomedSize(canvasSize.width() * style()->effectiveZoom(), canvasS ize.height() * style()->effectiveZoom()); |
| 87 | 88 |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 100 updateLogicalWidth(); | 101 updateLogicalWidth(); |
| 101 updateLogicalHeight(); | 102 updateLogicalHeight(); |
| 102 if (oldSize == size()) | 103 if (oldSize == size()) |
| 103 return; | 104 return; |
| 104 | 105 |
| 105 if (!selfNeedsLayout()) | 106 if (!selfNeedsLayout()) |
| 106 setNeedsLayout(); | 107 setNeedsLayout(); |
| 107 } | 108 } |
| 108 | 109 |
| 109 } // namespace WebCore | 110 } // namespace WebCore |
| OLD | NEW |