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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 | 48 |
49 class AffineTransform; | 49 class AffineTransform; |
50 class CanvasContextCreationAttributes; | 50 class CanvasContextCreationAttributes; |
51 class CanvasRenderingContext; | 51 class CanvasRenderingContext; |
52 class CanvasRenderingContextFactory; | 52 class CanvasRenderingContextFactory; |
53 class GraphicsContext; | 53 class GraphicsContext; |
54 class HTMLCanvasElement; | 54 class HTMLCanvasElement; |
55 class Image; | 55 class Image; |
56 class ImageBuffer; | 56 class ImageBuffer; |
57 class ImageBufferSurface; | 57 class ImageBufferSurface; |
58 class ImageData; | |
59 class IntSize; | 58 class IntSize; |
60 | 59 |
61 class CORE_EXPORT CanvasObserver : public WillBeGarbageCollectedMixin { | 60 class CORE_EXPORT CanvasObserver : public WillBeGarbageCollectedMixin { |
62 DECLARE_EMPTY_VIRTUAL_DESTRUCTOR_WILL_BE_REMOVED(CanvasObserver); | 61 DECLARE_EMPTY_VIRTUAL_DESTRUCTOR_WILL_BE_REMOVED(CanvasObserver); |
63 public: | 62 public: |
64 virtual void canvasChanged(HTMLCanvasElement*, const FloatRect& changedRect)
= 0; | 63 virtual void canvasChanged(HTMLCanvasElement*, const FloatRect& changedRect)
= 0; |
65 virtual void canvasResized(HTMLCanvasElement*) = 0; | 64 virtual void canvasResized(HTMLCanvasElement*) = 0; |
66 #if !ENABLE(OILPAN) | 65 #if !ENABLE(OILPAN) |
67 virtual void canvasDestroyed(HTMLCanvasElement*) = 0; | 66 virtual void canvasDestroyed(HTMLCanvasElement*) = 0; |
68 #endif | 67 #endif |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 | 192 |
194 PassOwnPtr<ImageBufferSurface> createImageBufferSurface(const IntSize& devic
eSize, int* msaaSampleCount); | 193 PassOwnPtr<ImageBufferSurface> createImageBufferSurface(const IntSize& devic
eSize, int* msaaSampleCount); |
195 void createImageBuffer(); | 194 void createImageBuffer(); |
196 void createImageBufferInternal(PassOwnPtr<ImageBufferSurface> externalSurfac
e); | 195 void createImageBufferInternal(PassOwnPtr<ImageBufferSurface> externalSurfac
e); |
197 bool shouldUseDisplayList(const IntSize& deviceSize); | 196 bool shouldUseDisplayList(const IntSize& deviceSize); |
198 | 197 |
199 void setSurfaceSize(const IntSize&); | 198 void setSurfaceSize(const IntSize&); |
200 | 199 |
201 bool paintsIntoCanvasBuffer() const; | 200 bool paintsIntoCanvasBuffer() const; |
202 | 201 |
203 ImageData* toImageData(SourceDrawingBuffer) const; | |
204 String toDataURLInternal(const String& mimeType, const double* quality, Sour
ceDrawingBuffer) const; | 202 String toDataURLInternal(const String& mimeType, const double* quality, Sour
ceDrawingBuffer) const; |
205 | 203 |
206 WillBeHeapHashSet<RawPtrWillBeWeakMember<CanvasObserver>> m_observers; | 204 WillBeHeapHashSet<RawPtrWillBeWeakMember<CanvasObserver>> m_observers; |
207 | 205 |
208 IntSize m_size; | 206 IntSize m_size; |
209 | 207 |
210 OwnPtrWillBeMember<CanvasRenderingContext> m_context; | 208 OwnPtrWillBeMember<CanvasRenderingContext> m_context; |
211 | 209 |
212 bool m_ignoreReset; | 210 bool m_ignoreReset; |
213 bool m_accelerationDisabled; | 211 bool m_accelerationDisabled; |
214 FloatRect m_dirtyRect; | 212 FloatRect m_dirtyRect; |
215 | 213 |
216 mutable intptr_t m_externallyAllocatedMemory; | 214 mutable intptr_t m_externallyAllocatedMemory; |
217 | 215 |
218 bool m_originClean; | 216 bool m_originClean; |
219 | 217 |
220 // It prevents HTMLCanvasElement::buffer() from continuously re-attempting t
o allocate an imageBuffer | 218 // It prevents HTMLCanvasElement::buffer() from continuously re-attempting t
o allocate an imageBuffer |
221 // after the first attempt failed. | 219 // after the first attempt failed. |
222 mutable bool m_didFailToCreateImageBuffer; | 220 mutable bool m_didFailToCreateImageBuffer; |
223 bool m_imageBufferIsClear; | 221 bool m_imageBufferIsClear; |
224 OwnPtr<ImageBuffer> m_imageBuffer; | 222 OwnPtr<ImageBuffer> m_imageBuffer; |
225 | 223 |
226 mutable RefPtr<Image> m_copiedImage; // FIXME: This is temporary for platfor
ms that have to copy the image buffer to render (and for CSSCanvasValue). | 224 mutable RefPtr<Image> m_copiedImage; // FIXME: This is temporary for platfor
ms that have to copy the image buffer to render (and for CSSCanvasValue). |
227 }; | 225 }; |
228 | 226 |
229 } // namespace blink | 227 } // namespace blink |
230 | 228 |
231 #endif // HTMLCanvasElement_h | 229 #endif // HTMLCanvasElement_h |
OLD | NEW |