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

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

Issue 957493003: Remove existingDrawingContext from HTMLCanvasElement (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « Source/core/html/HTMLCanvasElement.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 723 matching lines...) Expand 10 before | Expand all | Expand 10 after
734 // Subtracting two intptr_t that are known to be positive will never underfl ow. 734 // Subtracting two intptr_t that are known to be positive will never underfl ow.
735 v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(externallyA llocatedMemory - m_externallyAllocatedMemory); 735 v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(externallyA llocatedMemory - m_externallyAllocatedMemory);
736 m_externallyAllocatedMemory = externallyAllocatedMemory; 736 m_externallyAllocatedMemory = externallyAllocatedMemory;
737 } 737 }
738 738
739 GraphicsContext* HTMLCanvasElement::drawingContext() const 739 GraphicsContext* HTMLCanvasElement::drawingContext() const
740 { 740 {
741 return buffer() ? m_imageBuffer->context() : nullptr; 741 return buffer() ? m_imageBuffer->context() : nullptr;
742 } 742 }
743 743
744 GraphicsContext* HTMLCanvasElement::existingDrawingContext() const
745 {
746 if (!hasImageBuffer())
747 return nullptr;
748
749 return drawingContext();
750 }
751
752 SkCanvas* HTMLCanvasElement::drawingCanvas() const 744 SkCanvas* HTMLCanvasElement::drawingCanvas() const
753 { 745 {
754 return buffer() ? m_imageBuffer->canvas() : nullptr; 746 return buffer() ? m_imageBuffer->canvas() : nullptr;
755 } 747 }
756 748
757 SkCanvas* HTMLCanvasElement::existingDrawingCanvas() const 749 SkCanvas* HTMLCanvasElement::existingDrawingCanvas() const
758 { 750 {
759 if (!hasImageBuffer()) 751 if (!hasImageBuffer())
760 return nullptr; 752 return nullptr;
761 753
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
893 { 885 {
894 return FloatSize(width(), height()); 886 return FloatSize(width(), height());
895 } 887 }
896 888
897 bool HTMLCanvasElement::isOpaque() const 889 bool HTMLCanvasElement::isOpaque() const
898 { 890 {
899 return m_context && !m_context->hasAlpha(); 891 return m_context && !m_context->hasAlpha();
900 } 892 }
901 893
902 } // blink 894 } // blink
OLDNEW
« no previous file with comments | « Source/core/html/HTMLCanvasElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698