| 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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 | 128 |
| 129 // Used for canvas capture. | 129 // Used for canvas capture. |
| 130 void addListener(CanvasDrawListener*); | 130 void addListener(CanvasDrawListener*); |
| 131 void removeListener(CanvasDrawListener*); | 131 void removeListener(CanvasDrawListener*); |
| 132 | 132 |
| 133 // Used for rendering | 133 // Used for rendering |
| 134 void didDraw(const FloatRect&); | 134 void didDraw(const FloatRect&); |
| 135 | 135 |
| 136 void paint(GraphicsContext&, const LayoutRect&); | 136 void paint(GraphicsContext&, const LayoutRect&); |
| 137 | 137 |
| 138 SkCanvas* drawingCanvas() const; | 138 CdlCanvas* drawingCanvas() const; |
| 139 void disableDeferral(DisableDeferralReason) const; | 139 void disableDeferral(DisableDeferralReason) const; |
| 140 SkCanvas* existingDrawingCanvas() const; | 140 CdlCanvas* existingDrawingCanvas() const; |
| 141 | 141 |
| 142 CanvasRenderingContext* renderingContext() const { return m_context.get(); } | 142 CanvasRenderingContext* renderingContext() const { return m_context.get(); } |
| 143 | 143 |
| 144 void ensureUnacceleratedImageBuffer(); | 144 void ensureUnacceleratedImageBuffer(); |
| 145 ImageBuffer* buffer() const; | 145 ImageBuffer* buffer() const; |
| 146 PassRefPtr<Image> copiedImage(SourceDrawingBuffer, AccelerationHint) const; | 146 PassRefPtr<Image> copiedImage(SourceDrawingBuffer, AccelerationHint) const; |
| 147 void clearCopiedImage(); | 147 void clearCopiedImage(); |
| 148 | 148 |
| 149 SecurityOrigin* getSecurityOrigin() const; | 149 SecurityOrigin* getSecurityOrigin() const; |
| 150 bool originClean() const; | 150 bool originClean() const; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 bool isOpaque() const override; | 183 bool isOpaque() const override; |
| 184 bool isAccelerated() const override; | 184 bool isAccelerated() const override; |
| 185 int sourceWidth() override { return m_size.width(); } | 185 int sourceWidth() override { return m_size.width(); } |
| 186 int sourceHeight() override { return m_size.height(); } | 186 int sourceHeight() override { return m_size.height(); } |
| 187 | 187 |
| 188 // ImageBufferClient implementation | 188 // ImageBufferClient implementation |
| 189 void notifySurfaceInvalid() override; | 189 void notifySurfaceInvalid() override; |
| 190 bool isDirty() override { return !m_dirtyRect.isEmpty(); } | 190 bool isDirty() override { return !m_dirtyRect.isEmpty(); } |
| 191 void didDisableAcceleration() override; | 191 void didDisableAcceleration() override; |
| 192 void didFinalizeFrame() override; | 192 void didFinalizeFrame() override; |
| 193 void restoreCanvasMatrixClipStack(SkCanvas*) const override; | 193 void restoreCanvasMatrixClipStack(CdlCanvas*) const override; |
| 194 | 194 |
| 195 void doDeferredPaintInvalidation(); | 195 void doDeferredPaintInvalidation(); |
| 196 | 196 |
| 197 // ImageBitmapSource implementation | 197 // ImageBitmapSource implementation |
| 198 IntSize bitmapSourceSize() const override; | 198 IntSize bitmapSourceSize() const override; |
| 199 ScriptPromise createImageBitmap(ScriptState*, | 199 ScriptPromise createImageBitmap(ScriptState*, |
| 200 EventTarget&, | 200 EventTarget&, |
| 201 Optional<IntRect> cropRect, | 201 Optional<IntRect> cropRect, |
| 202 const ImageBitmapOptions&, | 202 const ImageBitmapOptions&, |
| 203 ExceptionState&) override; | 203 ExceptionState&) override; |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 // Used for OffscreenCanvas that controls this HTML canvas element | 304 // Used for OffscreenCanvas that controls this HTML canvas element |
| 305 std::unique_ptr<CanvasSurfaceLayerBridge> m_surfaceLayerBridge; | 305 std::unique_ptr<CanvasSurfaceLayerBridge> m_surfaceLayerBridge; |
| 306 | 306 |
| 307 int m_numFramesSinceLastRenderingModeSwitch; | 307 int m_numFramesSinceLastRenderingModeSwitch; |
| 308 bool m_pendingRenderingModeSwitch; | 308 bool m_pendingRenderingModeSwitch; |
| 309 }; | 309 }; |
| 310 | 310 |
| 311 } // namespace blink | 311 } // namespace blink |
| 312 | 312 |
| 313 #endif // HTMLCanvasElement_h | 313 #endif // HTMLCanvasElement_h |
| OLD | NEW |