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

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

Issue 1297663002: Eliminate deferral overhead with canvas to canvas draws (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: git cl web 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 726 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 // Subtracting two intptr_t that are known to be positive will never underfl ow. 737 // Subtracting two intptr_t that are known to be positive will never underfl ow.
738 v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(externallyA llocatedMemory - m_externallyAllocatedMemory); 738 v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(externallyA llocatedMemory - m_externallyAllocatedMemory);
739 m_externallyAllocatedMemory = externallyAllocatedMemory; 739 m_externallyAllocatedMemory = externallyAllocatedMemory;
740 } 740 }
741 741
742 SkCanvas* HTMLCanvasElement::drawingCanvas() const 742 SkCanvas* HTMLCanvasElement::drawingCanvas() const
743 { 743 {
744 return buffer() ? m_imageBuffer->canvas() : nullptr; 744 return buffer() ? m_imageBuffer->canvas() : nullptr;
745 } 745 }
746 746
747 SkCanvas* HTMLCanvasElement::immediateDrawingCanvas() const 747 void HTMLCanvasElement::disableDeferral() const
748 { 748 {
749 return buffer() ? m_imageBuffer->immediateCanvas() : nullptr; 749 if (buffer())
750 m_imageBuffer->disableDeferral();
750 } 751 }
751 752
752 SkCanvas* HTMLCanvasElement::existingDrawingCanvas() const 753 SkCanvas* HTMLCanvasElement::existingDrawingCanvas() const
753 { 754 {
754 if (!hasImageBuffer()) 755 if (!hasImageBuffer())
755 return nullptr; 756 return nullptr;
756 757
757 return m_imageBuffer->canvas(); 758 return m_imageBuffer->canvas();
758 } 759 }
759 760
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
891 { 892 {
892 return FloatSize(width(), height()); 893 return FloatSize(width(), height());
893 } 894 }
894 895
895 bool HTMLCanvasElement::isOpaque() const 896 bool HTMLCanvasElement::isOpaque() const
896 { 897 {
897 return m_context && !m_context->hasAlpha(); 898 return m_context && !m_context->hasAlpha();
898 } 899 }
899 900
900 } // blink 901 } // blink
OLDNEW
« no previous file with comments | « Source/core/html/HTMLCanvasElement.h ('k') | Source/modules/canvas2d/CanvasRenderingContext2D.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698