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 * Copyright (C) 2007 Alp Toker <alp@atoker.com> | 3 * Copyright (C) 2007 Alp Toker <alp@atoker.com> |
| 4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. | 4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 262 } | 262 } |
| 263 | 263 |
| 264 void HTMLCanvasElement::didDraw(const FloatRect& rect) | 264 void HTMLCanvasElement::didDraw(const FloatRect& rect) |
| 265 { | 265 { |
| 266 if (rect.isEmpty()) | 266 if (rect.isEmpty()) |
| 267 return; | 267 return; |
| 268 m_imageBufferIsClear = false; | 268 m_imageBufferIsClear = false; |
| 269 clearCopiedImage(); | 269 clearCopiedImage(); |
| 270 if (layoutObject()) | 270 if (layoutObject()) |
| 271 layoutObject()->setMayNeedPaintInvalidation(); | 271 layoutObject()->setMayNeedPaintInvalidation(); |
| 272 m_dirtyRect.unite(rect); | |
| 272 if (m_context && m_context->is2d() && m_context->shouldAntialias() && page() && page()->deviceScaleFactor() > 1.0f) | 273 if (m_context && m_context->is2d() && m_context->shouldAntialias() && page() && page()->deviceScaleFactor() > 1.0f) |
| 273 m_dirtyRect.inflate(1); | 274 m_dirtyRect.inflate(1); |
|
Justin Novosad
2016/05/18 19:11:42
what you meant to do is inflate "rect" before the
| |
| 274 m_dirtyRect.unite(rect); | |
| 275 if (m_context && m_context->is2d() && hasImageBuffer()) | 275 if (m_context && m_context->is2d() && hasImageBuffer()) |
| 276 buffer()->didDraw(rect); | 276 buffer()->didDraw(rect); |
| 277 } | 277 } |
| 278 | 278 |
| 279 void HTMLCanvasElement::didFinalizeFrame() | 279 void HTMLCanvasElement::didFinalizeFrame() |
| 280 { | 280 { |
| 281 notifyListenersCanvasChanged(); | 281 notifyListenersCanvasChanged(); |
| 282 | 282 |
| 283 if (m_dirtyRect.isEmpty()) | 283 if (m_dirtyRect.isEmpty()) |
| 284 return; | 284 return; |
| (...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1126 } | 1126 } |
| 1127 | 1127 |
| 1128 String HTMLCanvasElement::getIdFromControl(const Element* element) | 1128 String HTMLCanvasElement::getIdFromControl(const Element* element) |
| 1129 { | 1129 { |
| 1130 if (m_context) | 1130 if (m_context) |
| 1131 return m_context->getIdFromControl(element); | 1131 return m_context->getIdFromControl(element); |
| 1132 return String(); | 1132 return String(); |
| 1133 } | 1133 } |
| 1134 | 1134 |
| 1135 } // namespace blink | 1135 } // namespace blink |
| OLD | NEW |