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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp

Issue 1983863002: Inflate dirty rect by 1 pixel on a high DPI display (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nullcheck on page() Created 4 years, 7 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
OLDNEW
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
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 if (m_context && m_context->is2d() && m_context->shouldAntialias() && page() && page()->deviceScaleFactor() > 1.0f)
273 m_dirtyRect.inflate(1);
272 m_dirtyRect.unite(rect); 274 m_dirtyRect.unite(rect);
273 if (m_context && m_context->is2d() && hasImageBuffer()) 275 if (m_context && m_context->is2d() && hasImageBuffer())
274 buffer()->didDraw(rect); 276 buffer()->didDraw(rect);
275 } 277 }
276 278
277 void HTMLCanvasElement::didFinalizeFrame() 279 void HTMLCanvasElement::didFinalizeFrame()
278 { 280 {
279 notifyListenersCanvasChanged(); 281 notifyListenersCanvasChanged();
280 282
281 if (m_dirtyRect.isEmpty()) 283 if (m_dirtyRect.isEmpty())
(...skipping 842 matching lines...) Expand 10 before | Expand all | Expand 10 after
1124 } 1126 }
1125 1127
1126 String HTMLCanvasElement::getIdFromControl(const Element* element) 1128 String HTMLCanvasElement::getIdFromControl(const Element* element)
1127 { 1129 {
1128 if (m_context) 1130 if (m_context)
1129 return m_context->getIdFromControl(element); 1131 return m_context->getIdFromControl(element);
1130 return String(); 1132 return String();
1131 } 1133 }
1132 1134
1133 } // namespace blink 1135 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698