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

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

Issue 1093673002: Removing the dependency on GraphicsContext for drawing images in 2D canvas (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix for overdraw optimization failures and fix for mac build Created 5 years, 8 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 639 matching lines...) Expand 10 before | Expand all | Expand 10 after
650 m_didFailToCreateImageBuffer = false; 650 m_didFailToCreateImageBuffer = false;
651 651
652 updateExternallyAllocatedMemory(); 652 updateExternallyAllocatedMemory();
653 653
654 if (is3D()) { 654 if (is3D()) {
655 // Early out for WebGL canvases 655 // Early out for WebGL canvases
656 return; 656 return;
657 } 657 }
658 658
659 m_imageBuffer->setClient(this); 659 m_imageBuffer->setClient(this);
660 m_imageBuffer->context()->setShouldClampToSourceRect(false);
661 m_imageBuffer->context()->disableAntialiasingOptimizationForHairlineImages() ; 660 m_imageBuffer->context()->disableAntialiasingOptimizationForHairlineImages() ;
662 m_imageBuffer->context()->setImageInterpolationQuality(CanvasDefaultInterpol ationQuality); 661 m_imageBuffer->context()->setImageInterpolationQuality(CanvasDefaultInterpol ationQuality);
663 // Enabling MSAA overrides a request to disable antialiasing. This is true r egardless of whether the 662 // Enabling MSAA overrides a request to disable antialiasing. This is true r egardless of whether the
664 // rendering mode is accelerated or not. For consistency, we don't want to a pply AA in accelerated 663 // rendering mode is accelerated or not. For consistency, we don't want to a pply AA in accelerated
665 // canvases but not in unaccelerated canvases. 664 // canvases but not in unaccelerated canvases.
666 if (!msaaSampleCount && document().settings() && !document().settings()->ant ialiased2dCanvasEnabled()) 665 if (!msaaSampleCount && document().settings() && !document().settings()->ant ialiased2dCanvasEnabled())
667 m_imageBuffer->context()->setShouldAntialias(false); 666 m_imageBuffer->context()->setShouldAntialias(false);
668 #if ENABLE(ASSERT) 667 #if ENABLE(ASSERT)
669 m_imageBuffer->context()->disableDestructionChecks(); // 2D canvas is allowe d to leave context in an unfinalized state. 668 m_imageBuffer->context()->disableDestructionChecks(); // 2D canvas is allowe d to leave context in an unfinalized state.
670 #endif 669 #endif
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
871 { 870 {
872 return FloatSize(width(), height()); 871 return FloatSize(width(), height());
873 } 872 }
874 873
875 bool HTMLCanvasElement::isOpaque() const 874 bool HTMLCanvasElement::isOpaque() const
876 { 875 {
877 return m_context && !m_context->hasAlpha(); 876 return m_context && !m_context->hasAlpha();
878 } 877 }
879 878
880 } // blink 879 } // blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698