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

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

Issue 381113003: Revert 177827 "WebGL: Free temporary GPU resources held by inact..." (Closed) Base URL: svn://svn.chromium.org/blink/
Patch Set: Created 6 years, 5 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 632 matching lines...) Expand 10 before | Expand all | Expand 10 after
643 } 643 }
644 644
645 AffineTransform HTMLCanvasElement::baseTransform() const 645 AffineTransform HTMLCanvasElement::baseTransform() const
646 { 646 {
647 ASSERT(hasImageBuffer() && !m_didFailToCreateImageBuffer); 647 ASSERT(hasImageBuffer() && !m_didFailToCreateImageBuffer);
648 return m_imageBuffer->baseTransform(); 648 return m_imageBuffer->baseTransform();
649 } 649 }
650 650
651 void HTMLCanvasElement::didChangeVisibilityState(PageVisibilityState visibility) 651 void HTMLCanvasElement::didChangeVisibilityState(PageVisibilityState visibility)
652 { 652 {
653 if (!m_context) 653 if (hasImageBuffer()) {
654 return; 654 bool hidden = visibility != PageVisibilityStateVisible;
655 bool hidden = visibility != PageVisibilityStateVisible; 655 if (hidden) {
656 m_context->setIsHidden(hidden); 656 clearCopiedImage();
657 if (hidden) { 657 if (is3D()) {
658 clearCopiedImage(); 658 discardImageBuffer();
659 if (is3D()) { 659 }
660 discardImageBuffer(); 660 }
661 if (hasImageBuffer()) {
662 m_imageBuffer->setIsHidden(hidden);
661 } 663 }
662 } 664 }
663 } 665 }
664 666
665 void HTMLCanvasElement::didMoveToNewDocument(Document& oldDocument) 667 void HTMLCanvasElement::didMoveToNewDocument(Document& oldDocument)
666 { 668 {
667 setObservedDocument(document()); 669 setObservedDocument(document());
668 HTMLElement::didMoveToNewDocument(oldDocument); 670 HTMLElement::didMoveToNewDocument(oldDocument);
669 } 671 }
670 672
(...skipping 27 matching lines...) Expand all
698 { 700 {
699 return !originClean(); 701 return !originClean();
700 } 702 }
701 703
702 FloatSize HTMLCanvasElement::sourceSize() const 704 FloatSize HTMLCanvasElement::sourceSize() const
703 { 705 {
704 return FloatSize(width(), height()); 706 return FloatSize(width(), height());
705 } 707 }
706 708
707 } 709 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698