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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 void didMoveToNewDocument(Document& oldDocument) override; | 215 void didMoveToNewDocument(Document& oldDocument) override; |
216 | 216 |
217 private: | 217 private: |
218 explicit HTMLCanvasElement(Document&); | 218 explicit HTMLCanvasElement(Document&); |
219 void dispose(); | 219 void dispose(); |
220 | 220 |
221 using ContextFactoryVector = Vector<std::unique_ptr<CanvasRenderingContextFa
ctory>>; | 221 using ContextFactoryVector = Vector<std::unique_ptr<CanvasRenderingContextFa
ctory>>; |
222 static ContextFactoryVector& renderingContextFactories(); | 222 static ContextFactoryVector& renderingContextFactories(); |
223 static CanvasRenderingContextFactory* getRenderingContextFactory(int); | 223 static CanvasRenderingContextFactory* getRenderingContextFactory(int); |
224 | 224 |
225 bool shouldAccelerate(const IntSize&, const WebGraphicsContext3DProvider* sh
aredMainThreadContextProvider) const; | 225 bool shouldAccelerate(const IntSize&) const; |
226 | 226 |
227 void parseAttribute(const QualifiedName&, const AtomicString&, const AtomicS
tring&) override; | 227 void parseAttribute(const QualifiedName&, const AtomicString&, const AtomicS
tring&) override; |
228 LayoutObject* createLayoutObject(const ComputedStyle&) override; | 228 LayoutObject* createLayoutObject(const ComputedStyle&) override; |
229 bool areAuthorShadowsAllowed() const override { return false; } | 229 bool areAuthorShadowsAllowed() const override { return false; } |
230 | 230 |
231 void reset(); | 231 void reset(); |
232 | 232 |
233 std::unique_ptr<ImageBufferSurface> createImageBufferSurface(const IntSize&
deviceSize, int* msaaSampleCount, sk_sp<SkColorSpace>); | 233 std::unique_ptr<ImageBufferSurface> createAcceleratedImageBufferSurface(cons
t IntSize& deviceSize, OpacityMode, sk_sp<SkColorSpace>, int* msaaSampleCount); |
| 234 std::unique_ptr<ImageBufferSurface> createUnacceleratedImageBufferSurface(co
nst IntSize& deviceSize, OpacityMode, sk_sp<SkColorSpace>); |
234 void createImageBuffer(); | 235 void createImageBuffer(); |
235 void createImageBufferInternal(std::unique_ptr<ImageBufferSurface> externalS
urface); | 236 void createImageBufferInternal(std::unique_ptr<ImageBufferSurface> externalS
urface); |
236 bool shouldUseDisplayList(const IntSize& deviceSize); | 237 bool shouldUseDisplayList(const IntSize& deviceSize); |
237 | 238 |
238 void setSurfaceSize(const IntSize&); | 239 void setSurfaceSize(const IntSize&); |
239 | 240 |
240 bool paintsIntoCanvasBuffer() const; | 241 bool paintsIntoCanvasBuffer() const; |
241 | 242 |
242 ImageData* toImageData(SourceDrawingBuffer, SnapshotReason) const; | 243 ImageData* toImageData(SourceDrawingBuffer, SnapshotReason) const; |
243 | 244 |
(...skipping 23 matching lines...) Expand all Loading... |
267 // Used for OffscreenCanvas that controls this HTML canvas element | 268 // Used for OffscreenCanvas that controls this HTML canvas element |
268 std::unique_ptr<CanvasSurfaceLayerBridge> m_surfaceLayerBridge; | 269 std::unique_ptr<CanvasSurfaceLayerBridge> m_surfaceLayerBridge; |
269 | 270 |
270 int m_numFramesSinceLastRenderingModeSwitch; | 271 int m_numFramesSinceLastRenderingModeSwitch; |
271 bool m_pendingRenderingModeSwitch; | 272 bool m_pendingRenderingModeSwitch; |
272 }; | 273 }; |
273 | 274 |
274 } // namespace blink | 275 } // namespace blink |
275 | 276 |
276 #endif // HTMLCanvasElement_h | 277 #endif // HTMLCanvasElement_h |
OLD | NEW |