OLD | NEW |
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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 SecurityOrigin* securityOrigin() const; | 113 SecurityOrigin* securityOrigin() const; |
114 void setOriginTainted() { m_originClean = false; } | 114 void setOriginTainted() { m_originClean = false; } |
115 bool originClean() const { return m_originClean; } | 115 bool originClean() const { return m_originClean; } |
116 | 116 |
117 StyleResolver* styleResolver(); | 117 StyleResolver* styleResolver(); |
118 | 118 |
119 AffineTransform baseTransform() const; | 119 AffineTransform baseTransform() const; |
120 | 120 |
121 bool is3D() const; | 121 bool is3D() const; |
122 | 122 |
123 bool hasCreatedImageBuffer() const { return m_hasCreatedImageBuffer; } | 123 bool hasImageBuffer() const { return m_imageBuffer.get(); } |
124 | 124 |
125 bool shouldAccelerate(const IntSize&) const; | 125 bool shouldAccelerate(const IntSize&) const; |
126 | 126 |
127 float deviceScaleFactor() const { return m_deviceScaleFactor; } | 127 float deviceScaleFactor() const { return m_deviceScaleFactor; } |
128 | 128 |
129 InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE; | 129 InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE; |
130 | 130 |
131 private: | 131 private: |
132 explicit HTMLCanvasElement(Document&); | 132 explicit HTMLCanvasElement(Document&); |
133 | 133 |
(...skipping 23 matching lines...) Expand all Loading... |
157 | 157 |
158 bool m_ignoreReset; | 158 bool m_ignoreReset; |
159 bool m_accelerationDisabled; | 159 bool m_accelerationDisabled; |
160 FloatRect m_dirtyRect; | 160 FloatRect m_dirtyRect; |
161 | 161 |
162 intptr_t m_externallyAllocatedMemory; | 162 intptr_t m_externallyAllocatedMemory; |
163 | 163 |
164 float m_deviceScaleFactor; // FIXME: This is always 1 and should probable be
deleted | 164 float m_deviceScaleFactor; // FIXME: This is always 1 and should probable be
deleted |
165 bool m_originClean; | 165 bool m_originClean; |
166 | 166 |
167 // m_createdImageBuffer means we tried to malloc the buffer. We didn't nece
ssarily get it. | 167 // It prevents HTMLCanvasElement::buffer() from continuously re-attempting t
o allocate an imageBuffer |
168 mutable bool m_hasCreatedImageBuffer; | 168 // after the first attempt failed. |
| 169 mutable bool m_didFailToCreateImageBuffer; |
169 mutable bool m_didClearImageBuffer; | 170 mutable bool m_didClearImageBuffer; |
170 OwnPtr<ImageBuffer> m_imageBuffer; | 171 OwnPtr<ImageBuffer> m_imageBuffer; |
171 mutable OwnPtr<GraphicsContextStateSaver> m_contextStateSaver; | 172 mutable OwnPtr<GraphicsContextStateSaver> m_contextStateSaver; |
172 | 173 |
173 mutable RefPtr<Image> m_presentedImage; | 174 mutable RefPtr<Image> m_presentedImage; |
174 mutable RefPtr<Image> m_copiedImage; // FIXME: This is temporary for platfor
ms that have to copy the image buffer to render (and for CSSCanvasValue). | 175 mutable RefPtr<Image> m_copiedImage; // FIXME: This is temporary for platfor
ms that have to copy the image buffer to render (and for CSSCanvasValue). |
175 }; | 176 }; |
176 | 177 |
177 DEFINE_NODE_TYPE_CASTS(HTMLCanvasElement, hasTagName(HTMLNames::canvasTag)); | 178 DEFINE_NODE_TYPE_CASTS(HTMLCanvasElement, hasTagName(HTMLNames::canvasTag)); |
178 | 179 |
179 } //namespace | 180 } //namespace |
180 | 181 |
181 #endif | 182 #endif |
OLD | NEW |