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

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

Issue 1295673003: Revert of 2D canvas: remain in deferred rendering mode with canvas to canvas drawImage (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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
442 void HTMLCanvasElement::setSurfaceSize(const IntSize& size) 437 void HTMLCanvasElement::setSurfaceSize(const IntSize& size)
443 { 438 {
444 m_size = size; 439 m_size = size;
445 m_didFailToCreateImageBuffer = false; 440 m_didFailToCreateImageBuffer = false;
446 discardImageBuffer(); 441 discardImageBuffer();
447 clearCopiedImage(); 442 clearCopiedImage();
448 if (m_context && m_context->is2d() && m_context->isContextLost()) { 443 if (m_context && m_context->is2d() && m_context->isContextLost()) {
449 m_context->didSetSurfaceSize(); 444 m_context->didSetSurfaceSize();
450 } 445 }
451 } 446 }
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
897 { 892 {
898 return FloatSize(width(), height()); 893 return FloatSize(width(), height());
899 } 894 }
900 895
901 bool HTMLCanvasElement::isOpaque() const 896 bool HTMLCanvasElement::isOpaque() const
902 { 897 {
903 return m_context && !m_context->hasAlpha(); 898 return m_context && !m_context->hasAlpha();
904 } 899 }
905 900
906 } // blink 901 } // 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