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

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

Issue 44253005: 2D Canvas: Refactor code re-attempting to allocate an imageBuffer. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@convertL
Patch Set: Created 7 years, 1 month 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 | « no previous file | Source/core/html/HTMLCanvasElement.cpp » ('j') | 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, 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2006, 2009, 2010 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 SecurityOrigin* securityOrigin() const; 119 SecurityOrigin* securityOrigin() const;
120 void setOriginTainted() { m_originClean = false; } 120 void setOriginTainted() { m_originClean = false; }
121 bool originClean() const { return m_originClean; } 121 bool originClean() const { return m_originClean; }
122 122
123 StyleResolver* styleResolver(); 123 StyleResolver* styleResolver();
124 124
125 AffineTransform baseTransform() const; 125 AffineTransform baseTransform() const;
126 126
127 bool is3D() const; 127 bool is3D() const;
128 128
129 bool hasCreatedImageBuffer() const { return m_hasCreatedImageBuffer; }
130
131 bool shouldAccelerate(const IntSize&) const; 129 bool shouldAccelerate(const IntSize&) const;
132 130
133 float deviceScaleFactor() const { return m_deviceScaleFactor; } 131 float deviceScaleFactor() const { return m_deviceScaleFactor; }
134 132
135 InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE; 133 InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE;
136 134
137 private: 135 private:
138 HTMLCanvasElement(const QualifiedName&, Document&); 136 HTMLCanvasElement(const QualifiedName&, Document&);
139 137
140 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERR IDE; 138 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERR IDE;
(...skipping 21 matching lines...) Expand all
162 160
163 bool m_ignoreReset; 161 bool m_ignoreReset;
164 bool m_accelerationDisabled; 162 bool m_accelerationDisabled;
165 FloatRect m_dirtyRect; 163 FloatRect m_dirtyRect;
166 164
167 intptr_t m_externallyAllocatedMemory; 165 intptr_t m_externallyAllocatedMemory;
168 166
169 float m_deviceScaleFactor; // FIXME: This is always 1 and should probable be deleted 167 float m_deviceScaleFactor; // FIXME: This is always 1 and should probable be deleted
170 bool m_originClean; 168 bool m_originClean;
171 169
172 // m_createdImageBuffer means we tried to malloc the buffer. We didn't nece ssarily get it. 170 // m_createdImageBuffer means we tried to malloc the buffer. We didn't nece ssarily get it.
aandrey 2013/10/25 20:03:35 is this comment still relevant?
173 mutable bool m_hasCreatedImageBuffer;
174 mutable bool m_didClearImageBuffer; 171 mutable bool m_didClearImageBuffer;
175 OwnPtr<ImageBuffer> m_imageBuffer; 172 OwnPtr<ImageBuffer> m_imageBuffer;
176 mutable OwnPtr<GraphicsContextStateSaver> m_contextStateSaver; 173 mutable OwnPtr<GraphicsContextStateSaver> m_contextStateSaver;
177 174
178 mutable RefPtr<Image> m_presentedImage; 175 mutable RefPtr<Image> m_presentedImage;
179 mutable RefPtr<Image> m_copiedImage; // FIXME: This is temporary for platfor ms that have to copy the image buffer to render (and for CSSCanvasValue). 176 mutable RefPtr<Image> m_copiedImage; // FIXME: This is temporary for platfor ms that have to copy the image buffer to render (and for CSSCanvasValue).
180 }; 177 };
181 178
182 DEFINE_NODE_TYPE_CASTS(HTMLCanvasElement, hasTagName(HTMLNames::canvasTag)); 179 DEFINE_NODE_TYPE_CASTS(HTMLCanvasElement, hasTagName(HTMLNames::canvasTag));
183 180
184 } //namespace 181 } //namespace
185 182
186 #endif 183 #endif
OLDNEW
« no previous file with comments | « no previous file | Source/core/html/HTMLCanvasElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698