Chromium Code Reviews| 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 112 | 112 |
| 113 void paint(GraphicsContext*, const LayoutRect&); | 113 void paint(GraphicsContext*, const LayoutRect&); |
| 114 | 114 |
| 115 GraphicsContext* drawingContext() const; | 115 GraphicsContext* drawingContext() const; |
| 116 GraphicsContext* existingDrawingContext() const; | 116 GraphicsContext* existingDrawingContext() const; |
| 117 | 117 |
| 118 CanvasRenderingContext* renderingContext() const { return m_context.get(); } | 118 CanvasRenderingContext* renderingContext() const { return m_context.get(); } |
| 119 | 119 |
| 120 void ensureUnacceleratedImageBuffer(); | 120 void ensureUnacceleratedImageBuffer(); |
| 121 ImageBuffer* buffer() const; | 121 ImageBuffer* buffer() const; |
| 122 Image* copiedImage() const; | 122 enum SourceBuffer { Front, Back }; |
|
Ken Russell (switch to Gerrit)
2014/11/26 00:49:10
There are now three copies of this enum. Could you
dshwang
2014/11/26 13:37:29
Nice suggestion. I thought it's not pretty but I d
| |
| 123 Image* copiedImage(SourceBuffer) const; | |
| 123 void clearCopiedImage(); | 124 void clearCopiedImage(); |
| 124 PassRefPtrWillBeRawPtr<ImageData> getImageData() const; | |
| 125 | 125 |
| 126 SecurityOrigin* securityOrigin() const; | 126 SecurityOrigin* securityOrigin() const; |
| 127 bool originClean() const { return m_originClean; } | 127 bool originClean() const { return m_originClean; } |
| 128 void setOriginTainted() { m_originClean = false; } | 128 void setOriginTainted() { m_originClean = false; } |
| 129 | 129 |
| 130 AffineTransform baseTransform() const; | 130 AffineTransform baseTransform() const; |
| 131 | 131 |
| 132 bool is3D() const; | 132 bool is3D() const; |
| 133 | 133 |
| 134 bool hasImageBuffer() const { return m_imageBuffer; } | 134 bool hasImageBuffer() const { return m_imageBuffer; } |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 180 bool shouldUseDisplayList(const IntSize& deviceSize); | 180 bool shouldUseDisplayList(const IntSize& deviceSize); |
| 181 | 181 |
| 182 void resetDirtyRect(); | 182 void resetDirtyRect(); |
| 183 | 183 |
| 184 void setSurfaceSize(const IntSize&); | 184 void setSurfaceSize(const IntSize&); |
| 185 | 185 |
| 186 bool paintsIntoCanvasBuffer() const; | 186 bool paintsIntoCanvasBuffer() const; |
| 187 | 187 |
| 188 void updateExternallyAllocatedMemory() const; | 188 void updateExternallyAllocatedMemory() const; |
| 189 | 189 |
| 190 String toDataURLInternal(const String& mimeType, const double* quality, bool isSaving = false) const; | 190 String toDataURLInternal(const String& mimeType, const double* quality, Sour ceBuffer) const; |
| 191 | 191 |
| 192 WillBeHeapHashSet<RawPtrWillBeWeakMember<CanvasObserver>> m_observers; | 192 WillBeHeapHashSet<RawPtrWillBeWeakMember<CanvasObserver>> m_observers; |
| 193 | 193 |
| 194 IntSize m_size; | 194 IntSize m_size; |
| 195 | 195 |
| 196 OwnPtrWillBeMember<CanvasRenderingContext> m_context; | 196 OwnPtrWillBeMember<CanvasRenderingContext> m_context; |
| 197 | 197 |
| 198 bool m_ignoreReset; | 198 bool m_ignoreReset; |
| 199 bool m_accelerationDisabled; | 199 bool m_accelerationDisabled; |
| 200 FloatRect m_dirtyRect; | 200 FloatRect m_dirtyRect; |
| 201 | 201 |
| 202 mutable intptr_t m_externallyAllocatedMemory; | 202 mutable intptr_t m_externallyAllocatedMemory; |
| 203 | 203 |
| 204 bool m_originClean; | 204 bool m_originClean; |
| 205 | 205 |
| 206 // It prevents HTMLCanvasElement::buffer() from continuously re-attempting t o allocate an imageBuffer | 206 // It prevents HTMLCanvasElement::buffer() from continuously re-attempting t o allocate an imageBuffer |
| 207 // after the first attempt failed. | 207 // after the first attempt failed. |
| 208 mutable bool m_didFailToCreateImageBuffer; | 208 mutable bool m_didFailToCreateImageBuffer; |
| 209 bool m_imageBufferIsClear; | 209 bool m_imageBufferIsClear; |
| 210 OwnPtr<ImageBuffer> m_imageBuffer; | 210 OwnPtr<ImageBuffer> m_imageBuffer; |
| 211 mutable OwnPtr<GraphicsContextStateSaver> m_contextStateSaver; | 211 mutable OwnPtr<GraphicsContextStateSaver> m_contextStateSaver; |
| 212 | 212 |
| 213 mutable RefPtr<Image> m_copiedImage; // FIXME: This is temporary for platfor ms that have to copy the image buffer to render (and for CSSCanvasValue). | 213 mutable RefPtr<Image> m_copiedImage; // FIXME: This is temporary for platfor ms that have to copy the image buffer to render (and for CSSCanvasValue). |
| 214 }; | 214 }; |
| 215 | 215 |
| 216 } // namespace blink | 216 } // namespace blink |
| 217 | 217 |
| 218 #endif // HTMLCanvasElement_h | 218 #endif // HTMLCanvasElement_h |
| OLD | NEW |