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

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

Issue 20231002: Replace RenderArena with PartitionAlloc (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase. Created 7 years, 4 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
« no previous file with comments | « Source/core/html/HTMLButtonElement.cpp ('k') | Source/core/html/HTMLDetailsElement.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 if (name == widthAttr || name == heightAttr) 104 if (name == widthAttr || name == heightAttr)
105 reset(); 105 reset();
106 HTMLElement::parseAttribute(name, value); 106 HTMLElement::parseAttribute(name, value);
107 } 107 }
108 108
109 RenderObject* HTMLCanvasElement::createRenderer(RenderStyle* style) 109 RenderObject* HTMLCanvasElement::createRenderer(RenderStyle* style)
110 { 110 {
111 Frame* frame = document()->frame(); 111 Frame* frame = document()->frame();
112 if (frame && frame->script()->canExecuteScripts(NotAboutToExecuteScript)) { 112 if (frame && frame->script()->canExecuteScripts(NotAboutToExecuteScript)) {
113 m_rendererIsCanvas = true; 113 m_rendererIsCanvas = true;
114 return new (document()->renderArena()) RenderHTMLCanvas(this); 114 return new RenderHTMLCanvas(this);
115 } 115 }
116 116
117 m_rendererIsCanvas = false; 117 m_rendererIsCanvas = false;
118 return HTMLElement::createRenderer(style); 118 return HTMLElement::createRenderer(style);
119 } 119 }
120 120
121 void HTMLCanvasElement::attach(const AttachContext& context) 121 void HTMLCanvasElement::attach(const AttachContext& context)
122 { 122 {
123 setIsInCanvasSubtree(true); 123 setIsInCanvasSubtree(true);
124 HTMLElement::attach(context); 124 HTMLElement::attach(context);
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 FloatSize unscaledSize = size(); 559 FloatSize unscaledSize = size();
560 FloatSize deviceSize = convertLogicalToDevice(unscaledSize); 560 FloatSize deviceSize = convertLogicalToDevice(unscaledSize);
561 IntSize size(deviceSize.width(), deviceSize.height()); 561 IntSize size(deviceSize.width(), deviceSize.height());
562 AffineTransform transform; 562 AffineTransform transform;
563 if (size.width() && size.height()) 563 if (size.width() && size.height())
564 transform.scaleNonUniform(size.width() / unscaledSize.width(), size.heig ht() / unscaledSize.height()); 564 transform.scaleNonUniform(size.width() / unscaledSize.width(), size.heig ht() / unscaledSize.height());
565 return m_imageBuffer->baseTransform() * transform; 565 return m_imageBuffer->baseTransform() * transform;
566 } 566 }
567 567
568 } 568 }
OLDNEW
« no previous file with comments | « Source/core/html/HTMLButtonElement.cpp ('k') | Source/core/html/HTMLDetailsElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698