| 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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 void discardImageBuffer(); | 163 void discardImageBuffer(); |
| 164 | 164 |
| 165 bool shouldBeDirectComposited() const; | 165 bool shouldBeDirectComposited() const; |
| 166 | 166 |
| 167 void prepareSurfaceForPaintingIfNeeded() const; | 167 void prepareSurfaceForPaintingIfNeeded() const; |
| 168 | 168 |
| 169 const AtomicString imageSourceURL() const override; | 169 const AtomicString imageSourceURL() const override; |
| 170 | 170 |
| 171 InsertionNotificationRequest insertedInto(ContainerNode*) override; | 171 InsertionNotificationRequest insertedInto(ContainerNode*) override; |
| 172 | 172 |
| 173 bool isDirty() { return !m_dirtyRect.isEmpty(); } |
| 174 |
| 175 void doDeferredPaintInvalidation(); |
| 176 |
| 177 void finalizeFrame(); |
| 178 |
| 173 // ContextLifecycleObserver and PageVisibilityObserver implementation | 179 // ContextLifecycleObserver and PageVisibilityObserver implementation |
| 174 void contextDestroyed(ExecutionContext*) override; | 180 void contextDestroyed(ExecutionContext*) override; |
| 175 | 181 |
| 176 // PageVisibilityObserver implementation | 182 // PageVisibilityObserver implementation |
| 177 void pageVisibilityChanged() override; | 183 void pageVisibilityChanged() override; |
| 178 | 184 |
| 179 // CanvasImageSource implementation | 185 // CanvasImageSource implementation |
| 180 PassRefPtr<Image> getSourceImageForCanvas(SourceImageStatus*, | 186 PassRefPtr<Image> getSourceImageForCanvas(SourceImageStatus*, |
| 181 AccelerationHint, | 187 AccelerationHint, |
| 182 SnapshotReason, | 188 SnapshotReason, |
| 183 const FloatSize&) const override; | 189 const FloatSize&) const override; |
| 184 bool wouldTaintOrigin(SecurityOrigin*) const override; | 190 bool wouldTaintOrigin(SecurityOrigin*) const override; |
| 185 FloatSize elementSize(const FloatSize&) const override; | 191 FloatSize elementSize(const FloatSize&) const override; |
| 186 bool isCanvasElement() const override { return true; } | 192 bool isCanvasElement() const override { return true; } |
| 187 bool isOpaque() const override; | 193 bool isOpaque() const override; |
| 188 bool isAccelerated() const override; | 194 bool isAccelerated() const override; |
| 189 int sourceWidth() override { return m_size.width(); } | 195 int sourceWidth() override { return m_size.width(); } |
| 190 int sourceHeight() override { return m_size.height(); } | 196 int sourceHeight() override { return m_size.height(); } |
| 191 | 197 |
| 192 // CanvasSurfaceLayerBridgeObserver implementation | 198 // CanvasSurfaceLayerBridgeObserver implementation |
| 193 void OnWebLayerReplaced() override; | 199 void OnWebLayerReplaced() override; |
| 194 | 200 |
| 195 // ImageBufferClient implementation | 201 // ImageBufferClient implementation |
| 196 void notifySurfaceInvalid() override; | 202 void notifySurfaceInvalid() override; |
| 197 bool isDirty() override { return !m_dirtyRect.isEmpty(); } | |
| 198 void didDisableAcceleration() override; | 203 void didDisableAcceleration() override; |
| 199 void didFinalizeFrame() override; | |
| 200 void restoreCanvasMatrixClipStack(PaintCanvas*) const override; | 204 void restoreCanvasMatrixClipStack(PaintCanvas*) const override; |
| 201 | 205 |
| 202 void doDeferredPaintInvalidation(); | |
| 203 | |
| 204 // ImageBitmapSource implementation | 206 // ImageBitmapSource implementation |
| 205 IntSize bitmapSourceSize() const override; | 207 IntSize bitmapSourceSize() const override; |
| 206 ScriptPromise createImageBitmap(ScriptState*, | 208 ScriptPromise createImageBitmap(ScriptState*, |
| 207 EventTarget&, | 209 EventTarget&, |
| 208 Optional<IntRect> cropRect, | 210 Optional<IntRect> cropRect, |
| 209 const ImageBitmapOptions&, | 211 const ImageBitmapOptions&, |
| 210 ExceptionState&) override; | 212 ExceptionState&) override; |
| 211 | 213 |
| 212 DECLARE_VIRTUAL_TRACE(); | 214 DECLARE_VIRTUAL_TRACE(); |
| 213 | 215 |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 // Used for OffscreenCanvas that controls this HTML canvas element | 314 // Used for OffscreenCanvas that controls this HTML canvas element |
| 313 std::unique_ptr<CanvasSurfaceLayerBridge> m_surfaceLayerBridge; | 315 std::unique_ptr<CanvasSurfaceLayerBridge> m_surfaceLayerBridge; |
| 314 | 316 |
| 315 int m_numFramesSinceLastRenderingModeSwitch; | 317 int m_numFramesSinceLastRenderingModeSwitch; |
| 316 bool m_pendingRenderingModeSwitch; | 318 bool m_pendingRenderingModeSwitch; |
| 317 }; | 319 }; |
| 318 | 320 |
| 319 } // namespace blink | 321 } // namespace blink |
| 320 | 322 |
| 321 #endif // HTMLCanvasElement_h | 323 #endif // HTMLCanvasElement_h |
| OLD | NEW |