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

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

Issue 899163003: Move rendering/RenderObject to layout/LayoutObject. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 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/HTMLCanvasElement.h ('k') | Source/core/html/HTMLDetailsElement.h » ('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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 #endif 130 #endif
131 } 131 }
132 132
133 void HTMLCanvasElement::parseAttribute(const QualifiedName& name, const AtomicSt ring& value) 133 void HTMLCanvasElement::parseAttribute(const QualifiedName& name, const AtomicSt ring& value)
134 { 134 {
135 if (name == widthAttr || name == heightAttr) 135 if (name == widthAttr || name == heightAttr)
136 reset(); 136 reset();
137 HTMLElement::parseAttribute(name, value); 137 HTMLElement::parseAttribute(name, value);
138 } 138 }
139 139
140 RenderObject* HTMLCanvasElement::createRenderer(const RenderStyle& style) 140 LayoutObject* HTMLCanvasElement::createRenderer(const RenderStyle& style)
141 { 141 {
142 LocalFrame* frame = document().frame(); 142 LocalFrame* frame = document().frame();
143 if (frame && frame->script().canExecuteScripts(NotAboutToExecuteScript)) 143 if (frame && frame->script().canExecuteScripts(NotAboutToExecuteScript))
144 return new RenderHTMLCanvas(this); 144 return new RenderHTMLCanvas(this);
145 return HTMLElement::createRenderer(style); 145 return HTMLElement::createRenderer(style);
146 } 146 }
147 147
148 void HTMLCanvasElement::didRecalcStyle(StyleRecalcChange) 148 void HTMLCanvasElement::didRecalcStyle(StyleRecalcChange)
149 { 149 {
150 SkPaint::FilterLevel filterLevel = computedStyle()->imageRendering() == Imag eRenderingPixelated ? SkPaint::kNone_FilterLevel : SkPaint::kLow_FilterLevel; 150 SkPaint::FilterLevel filterLevel = computedStyle()->imageRendering() == Imag eRenderingPixelated ? SkPaint::kNone_FilterLevel : SkPaint::kLow_FilterLevel;
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 toCanvasRenderingContext2D(m_context.get())->clearRect(0, 0, width() , height()); 352 toCanvasRenderingContext2D(m_context.get())->clearRect(0, 0, width() , height());
353 } 353 }
354 return; 354 return;
355 } 355 }
356 356
357 setSurfaceSize(newSize); 357 setSurfaceSize(newSize);
358 358
359 if (m_context && m_context->is3d() && oldSize != size()) 359 if (m_context && m_context->is3d() && oldSize != size())
360 toWebGLRenderingContext(m_context.get())->reshape(width(), height()); 360 toWebGLRenderingContext(m_context.get())->reshape(width(), height());
361 361
362 if (RenderObject* renderer = this->renderer()) { 362 if (LayoutObject* renderer = this->renderer()) {
363 if (renderer->isCanvas()) { 363 if (renderer->isCanvas()) {
364 if (oldSize != size()) { 364 if (oldSize != size()) {
365 toRenderHTMLCanvas(renderer)->canvasSizeChanged(); 365 toRenderHTMLCanvas(renderer)->canvasSizeChanged();
366 if (renderBox() && renderBox()->hasAcceleratedCompositing()) 366 if (renderBox() && renderBox()->hasAcceleratedCompositing())
367 renderBox()->contentChanged(CanvasChanged); 367 renderBox()->contentChanged(CanvasChanged);
368 } 368 }
369 if (hadImageBuffer) 369 if (hadImageBuffer)
370 renderer->setShouldDoFullPaintInvalidation(); 370 renderer->setShouldDoFullPaintInvalidation();
371 } 371 }
372 } 372 }
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
836 { 836 {
837 return !originClean(); 837 return !originClean();
838 } 838 }
839 839
840 FloatSize HTMLCanvasElement::sourceSize() const 840 FloatSize HTMLCanvasElement::sourceSize() const
841 { 841 {
842 return FloatSize(width(), height()); 842 return FloatSize(width(), height());
843 } 843 }
844 844
845 } 845 }
OLDNEW
« no previous file with comments | « Source/core/html/HTMLCanvasElement.h ('k') | Source/core/html/HTMLDetailsElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698