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

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

Issue 2001453002: Set ComputedStyle on Node and use that in buildOwnLayout() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@storage
Patch Set: Created 4 years, 5 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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 return canCreateImageBuffer(size()); 273 return canCreateImageBuffer(size());
274 return buffer(); 274 return buffer();
275 } 275 }
276 276
277 void HTMLCanvasElement::didDraw(const FloatRect& rect) 277 void HTMLCanvasElement::didDraw(const FloatRect& rect)
278 { 278 {
279 if (rect.isEmpty()) 279 if (rect.isEmpty())
280 return; 280 return;
281 m_imageBufferIsClear = false; 281 m_imageBufferIsClear = false;
282 clearCopiedImage(); 282 clearCopiedImage();
283 if (layoutObject()) 283 if (hasLayoutObject())
284 layoutObject()->setMayNeedPaintInvalidation(); 284 layoutObject()->setMayNeedPaintInvalidation();
285 if (m_context && m_context->is2d() && m_context->shouldAntialias() && page() && page()->deviceScaleFactor() > 1.0f) { 285 if (m_context && m_context->is2d() && m_context->shouldAntialias() && page() && page()->deviceScaleFactor() > 1.0f) {
286 FloatRect inflatedRect = rect; 286 FloatRect inflatedRect = rect;
287 inflatedRect.inflate(1); 287 inflatedRect.inflate(1);
288 m_dirtyRect.unite(inflatedRect); 288 m_dirtyRect.unite(inflatedRect);
289 } else { 289 } else {
290 m_dirtyRect.unite(rect); 290 m_dirtyRect.unite(rect);
291 } 291 }
292 if (m_context && m_context->is2d() && hasImageBuffer()) 292 if (m_context && m_context->is2d() && hasImageBuffer())
293 buffer()->didDraw(rect); 293 buffer()->didDraw(rect);
(...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after
1188 1188
1189 bool HTMLCanvasElement::createSurfaceLayer() 1189 bool HTMLCanvasElement::createSurfaceLayer()
1190 { 1190 {
1191 DCHECK(!m_surfaceLayerBridge); 1191 DCHECK(!m_surfaceLayerBridge);
1192 std::unique_ptr<CanvasSurfaceLayerBridgeClient> bridgeClient = wrapUnique(ne w CanvasSurfaceLayerBridgeClientImpl()); 1192 std::unique_ptr<CanvasSurfaceLayerBridgeClient> bridgeClient = wrapUnique(ne w CanvasSurfaceLayerBridgeClientImpl());
1193 m_surfaceLayerBridge = wrapUnique(new CanvasSurfaceLayerBridge(std::move(bri dgeClient))); 1193 m_surfaceLayerBridge = wrapUnique(new CanvasSurfaceLayerBridge(std::move(bri dgeClient)));
1194 return m_surfaceLayerBridge->createSurfaceLayer(this->width(), this->height( )); 1194 return m_surfaceLayerBridge->createSurfaceLayer(this->width(), this->height( ));
1195 } 1195 }
1196 1196
1197 } // namespace blink 1197 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698