| 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 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 toCanvasRenderingContext2D(m_context.get())->clearRect(0, 0, width()
, height()); | 383 toCanvasRenderingContext2D(m_context.get())->clearRect(0, 0, width()
, height()); |
| 384 } | 384 } |
| 385 return; | 385 return; |
| 386 } | 386 } |
| 387 | 387 |
| 388 setSurfaceSize(newSize); | 388 setSurfaceSize(newSize); |
| 389 | 389 |
| 390 if (m_context && m_context->is3d() && oldSize != size()) | 390 if (m_context && m_context->is3d() && oldSize != size()) |
| 391 toWebGLRenderingContextBase(m_context.get())->reshape(width(), height())
; | 391 toWebGLRenderingContextBase(m_context.get())->reshape(width(), height())
; |
| 392 | 392 |
| 393 if (LayoutObject* renderer = this->layoutObject()) { | 393 if (LayoutObject* layoutObject = this->layoutObject()) { |
| 394 if (renderer->isCanvas()) { | 394 if (layoutObject->isCanvas()) { |
| 395 if (oldSize != size()) { | 395 if (oldSize != size()) { |
| 396 toLayoutHTMLCanvas(renderer)->canvasSizeChanged(); | 396 toLayoutHTMLCanvas(layoutObject)->canvasSizeChanged(); |
| 397 if (layoutBox() && layoutBox()->hasAcceleratedCompositing()) | 397 if (layoutBox() && layoutBox()->hasAcceleratedCompositing()) |
| 398 layoutBox()->contentChanged(CanvasChanged); | 398 layoutBox()->contentChanged(CanvasChanged); |
| 399 } | 399 } |
| 400 if (hadImageBuffer) | 400 if (hadImageBuffer) |
| 401 renderer->setShouldDoFullPaintInvalidation(); | 401 layoutObject->setShouldDoFullPaintInvalidation(); |
| 402 } | 402 } |
| 403 } | 403 } |
| 404 | 404 |
| 405 for (CanvasObserver* canvasObserver : m_observers) | 405 for (CanvasObserver* canvasObserver : m_observers) |
| 406 canvasObserver->canvasResized(this); | 406 canvasObserver->canvasResized(this); |
| 407 } | 407 } |
| 408 | 408 |
| 409 bool HTMLCanvasElement::paintsIntoCanvasBuffer() const | 409 bool HTMLCanvasElement::paintsIntoCanvasBuffer() const |
| 410 { | 410 { |
| 411 ASSERT(m_context); | 411 ASSERT(m_context); |
| (...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 877 { | 877 { |
| 878 return FloatSize(width(), height()); | 878 return FloatSize(width(), height()); |
| 879 } | 879 } |
| 880 | 880 |
| 881 bool HTMLCanvasElement::isOpaque() const | 881 bool HTMLCanvasElement::isOpaque() const |
| 882 { | 882 { |
| 883 return m_context && !m_context->hasAlpha(); | 883 return m_context && !m_context->hasAlpha(); |
| 884 } | 884 } |
| 885 | 885 |
| 886 } // blink | 886 } // blink |
| OLD | NEW |