| 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 15 matching lines...) Expand all Loading... |
| 26 */ | 26 */ |
| 27 | 27 |
| 28 #ifndef HTMLCanvasElement_h | 28 #ifndef HTMLCanvasElement_h |
| 29 #define HTMLCanvasElement_h | 29 #define HTMLCanvasElement_h |
| 30 | 30 |
| 31 #include "core/html/HTMLElement.h" | 31 #include "core/html/HTMLElement.h" |
| 32 #include "core/html/canvas/CanvasImageSource.h" | 32 #include "core/html/canvas/CanvasImageSource.h" |
| 33 #include "platform/geometry/FloatRect.h" | 33 #include "platform/geometry/FloatRect.h" |
| 34 #include "platform/geometry/IntSize.h" | 34 #include "platform/geometry/IntSize.h" |
| 35 #include "platform/graphics/Canvas2DLayerBridge.h" | 35 #include "platform/graphics/Canvas2DLayerBridge.h" |
| 36 #include "platform/graphics/GraphicsTypes.h" |
| 36 #include "wtf/Forward.h" | 37 #include "wtf/Forward.h" |
| 37 | 38 |
| 38 #define DefaultInterpolationQuality InterpolationMedium | 39 #define DefaultInterpolationQuality InterpolationLow |
| 39 | 40 |
| 40 namespace WebCore { | 41 namespace WebCore { |
| 41 | 42 |
| 42 class AffineTransform; | 43 class AffineTransform; |
| 43 class CanvasContextAttributes; | 44 class CanvasContextAttributes; |
| 44 class CanvasRenderingContext; | 45 class CanvasRenderingContext; |
| 45 class GraphicsContext; | 46 class GraphicsContext; |
| 46 class GraphicsContextStateSaver; | 47 class GraphicsContextStateSaver; |
| 47 class HTMLCanvasElement; | 48 class HTMLCanvasElement; |
| 48 class Image; | 49 class Image; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 CanvasRenderingContext* getContext(const String&, CanvasContextAttributes* a
ttributes = 0); | 94 CanvasRenderingContext* getContext(const String&, CanvasContextAttributes* a
ttributes = 0); |
| 94 | 95 |
| 95 static String toEncodingMimeType(const String& mimeType); | 96 static String toEncodingMimeType(const String& mimeType); |
| 96 String toDataURL(const String& mimeType, const double* quality, ExceptionSta
te&); | 97 String toDataURL(const String& mimeType, const double* quality, ExceptionSta
te&); |
| 97 String toDataURL(const String& mimeType, ExceptionState& exceptionState) { r
eturn toDataURL(mimeType, 0, exceptionState); } | 98 String toDataURL(const String& mimeType, ExceptionState& exceptionState) { r
eturn toDataURL(mimeType, 0, exceptionState); } |
| 98 | 99 |
| 99 // Used for rendering | 100 // Used for rendering |
| 100 void didDraw(const FloatRect&); | 101 void didDraw(const FloatRect&); |
| 101 void notifyObserversCanvasChanged(const FloatRect&); | 102 void notifyObserversCanvasChanged(const FloatRect&); |
| 102 | 103 |
| 103 void paint(GraphicsContext*, const LayoutRect&, bool useLowQualityScale = fa
lse); | 104 void paint(GraphicsContext*, const LayoutRect&, InterpolationQuality = Inter
polationDefault); |
| 104 | 105 |
| 105 GraphicsContext* drawingContext() const; | 106 GraphicsContext* drawingContext() const; |
| 106 GraphicsContext* existingDrawingContext() const; | 107 GraphicsContext* existingDrawingContext() const; |
| 107 | 108 |
| 108 CanvasRenderingContext* renderingContext() const { return m_context.get(); } | 109 CanvasRenderingContext* renderingContext() const { return m_context.get(); } |
| 109 | 110 |
| 110 void ensureUnacceleratedImageBuffer(); | 111 void ensureUnacceleratedImageBuffer(); |
| 111 ImageBuffer* buffer() const; | 112 ImageBuffer* buffer() const; |
| 112 Image* copiedImage() const; | 113 Image* copiedImage() const; |
| 113 void clearCopiedImage(); | 114 void clearCopiedImage(); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 OwnPtr<ImageBuffer> m_imageBuffer; | 184 OwnPtr<ImageBuffer> m_imageBuffer; |
| 184 mutable OwnPtr<GraphicsContextStateSaver> m_contextStateSaver; | 185 mutable OwnPtr<GraphicsContextStateSaver> m_contextStateSaver; |
| 185 | 186 |
| 186 mutable RefPtr<Image> m_presentedImage; | 187 mutable RefPtr<Image> m_presentedImage; |
| 187 mutable RefPtr<Image> m_copiedImage; // FIXME: This is temporary for platfor
ms that have to copy the image buffer to render (and for CSSCanvasValue). | 188 mutable RefPtr<Image> m_copiedImage; // FIXME: This is temporary for platfor
ms that have to copy the image buffer to render (and for CSSCanvasValue). |
| 188 }; | 189 }; |
| 189 | 190 |
| 190 } //namespace | 191 } //namespace |
| 191 | 192 |
| 192 #endif | 193 #endif |
| OLD | NEW |