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

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

Issue 1288773005: 2D canvas: remain in deferred rendering mode with canvas to canvas drawImage (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add init of snapShot state Created 5 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
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 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 427
428 if (is3D() && paintsIntoCanvasBuffer()) 428 if (is3D() && paintsIntoCanvasBuffer())
429 m_context->markLayerComposited(); 429 m_context->markLayerComposited();
430 } 430 }
431 431
432 bool HTMLCanvasElement::is3D() const 432 bool HTMLCanvasElement::is3D() const
433 { 433 {
434 return m_context && m_context->is3d(); 434 return m_context && m_context->is3d();
435 } 435 }
436 436
437 bool HTMLCanvasElement::isAnimated2D() const
438 {
439 return m_context && m_context->is2d() && hasImageBuffer() && m_imageBuffer-> wasDrawnToAfterSnapshot();
440 }
441
437 void HTMLCanvasElement::setSurfaceSize(const IntSize& size) 442 void HTMLCanvasElement::setSurfaceSize(const IntSize& size)
438 { 443 {
439 m_size = size; 444 m_size = size;
440 m_didFailToCreateImageBuffer = false; 445 m_didFailToCreateImageBuffer = false;
441 discardImageBuffer(); 446 discardImageBuffer();
442 clearCopiedImage(); 447 clearCopiedImage();
443 if (m_context && m_context->is2d() && m_context->isContextLost()) { 448 if (m_context && m_context->is2d() && m_context->isContextLost()) {
444 m_context->didSetSurfaceSize(); 449 m_context->didSetSurfaceSize();
445 } 450 }
446 } 451 }
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
892 { 897 {
893 return FloatSize(width(), height()); 898 return FloatSize(width(), height());
894 } 899 }
895 900
896 bool HTMLCanvasElement::isOpaque() const 901 bool HTMLCanvasElement::isOpaque() const
897 { 902 {
898 return m_context && !m_context->hasAlpha(); 903 return m_context && !m_context->hasAlpha();
899 } 904 }
900 905
901 } // blink 906 } // blink
OLDNEW
« no previous file with comments | « Source/core/html/HTMLCanvasElement.h ('k') | Source/modules/canvas2d/CanvasRenderingContext2D.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698