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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 if (newSize == size()) | 94 if (newSize == size()) |
95 return; | 95 return; |
96 m_ignoreReset = true; | 96 m_ignoreReset = true; |
97 setWidth(newSize.width()); | 97 setWidth(newSize.width()); |
98 setHeight(newSize.height()); | 98 setHeight(newSize.height()); |
99 m_ignoreReset = false; | 99 m_ignoreReset = false; |
100 reset(); | 100 reset(); |
101 } | 101 } |
102 | 102 |
103 CanvasRenderingContext* getContext(const String&, CanvasContextAttributes* a
ttributes = 0); | 103 CanvasRenderingContext* getContext(const String&, CanvasContextAttributes* a
ttributes = 0); |
| 104 bool isPaintable() const; |
104 | 105 |
105 static String toEncodingMimeType(const String& mimeType); | 106 static String toEncodingMimeType(const String& mimeType); |
106 String toDataURL(const String& mimeType, const double* quality, ExceptionSta
te&) const; | 107 String toDataURL(const String& mimeType, const double* quality, ExceptionSta
te&) const; |
107 String toDataURL(const String& mimeType, ExceptionState& exceptionState) con
st { return toDataURL(mimeType, 0, exceptionState); } | 108 String toDataURL(const String& mimeType, ExceptionState& exceptionState) con
st { return toDataURL(mimeType, 0, exceptionState); } |
108 | 109 |
109 // Used for rendering | 110 // Used for rendering |
110 void didDraw(const FloatRect&); | 111 void didDraw(const FloatRect&); |
111 void notifyObserversCanvasChanged(const FloatRect&); | 112 void notifyObserversCanvasChanged(const FloatRect&); |
112 | 113 |
113 void paint(GraphicsContext*, const LayoutRect&); | 114 void paint(GraphicsContext*, const LayoutRect&); |
114 | 115 |
115 GraphicsContext* drawingContext() const; | 116 GraphicsContext* drawingContext() const; |
116 GraphicsContext* existingDrawingContext() const; | 117 GraphicsContext* existingDrawingContext() const; |
117 | 118 |
118 CanvasRenderingContext* renderingContext() const { return m_context.get(); } | 119 CanvasRenderingContext* renderingContext() const { return m_context.get(); } |
119 | 120 |
120 void ensureUnacceleratedImageBuffer(); | 121 void ensureUnacceleratedImageBuffer(); |
121 ImageBuffer* buffer() const; | 122 ImageBuffer* buffer() const; |
122 Image* copiedImage(SourceDrawingBuffer) const; | 123 PassRefPtr<Image> copiedImage(SourceDrawingBuffer) const; |
123 void clearCopiedImage(); | 124 void clearCopiedImage(); |
124 | 125 |
125 SecurityOrigin* securityOrigin() const; | 126 SecurityOrigin* securityOrigin() const; |
126 bool originClean() const { return m_originClean; } | 127 bool originClean() const { return m_originClean; } |
127 void setOriginTainted() { m_originClean = false; } | 128 void setOriginTainted() { m_originClean = false; } |
128 | 129 |
129 AffineTransform baseTransform() const; | 130 AffineTransform baseTransform() const; |
130 | 131 |
131 bool is3D() const; | 132 bool is3D() const; |
132 | 133 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 bool m_imageBufferIsClear; | 209 bool m_imageBufferIsClear; |
209 OwnPtr<ImageBuffer> m_imageBuffer; | 210 OwnPtr<ImageBuffer> m_imageBuffer; |
210 mutable OwnPtr<GraphicsContextStateSaver> m_contextStateSaver; | 211 mutable OwnPtr<GraphicsContextStateSaver> m_contextStateSaver; |
211 | 212 |
212 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). |
213 }; | 214 }; |
214 | 215 |
215 } // namespace blink | 216 } // namespace blink |
216 | 217 |
217 #endif // HTMLCanvasElement_h | 218 #endif // HTMLCanvasElement_h |
OLD | NEW |