Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLCanvasElement.h

Issue 1999143002: Add CanvasSurfaceLayerBridge (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: edit based on danakj's feedback Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 23 matching lines...) Expand all
34 #include "core/dom/DOMTypedArray.h" 34 #include "core/dom/DOMTypedArray.h"
35 #include "core/dom/Document.h" 35 #include "core/dom/Document.h"
36 #include "core/fileapi/BlobCallback.h" 36 #include "core/fileapi/BlobCallback.h"
37 #include "core/html/HTMLElement.h" 37 #include "core/html/HTMLElement.h"
38 #include "core/html/canvas/CanvasDrawListener.h" 38 #include "core/html/canvas/CanvasDrawListener.h"
39 #include "core/html/canvas/CanvasImageSource.h" 39 #include "core/html/canvas/CanvasImageSource.h"
40 #include "core/imagebitmap/ImageBitmapSource.h" 40 #include "core/imagebitmap/ImageBitmapSource.h"
41 #include "core/page/PageLifecycleObserver.h" 41 #include "core/page/PageLifecycleObserver.h"
42 #include "platform/geometry/FloatRect.h" 42 #include "platform/geometry/FloatRect.h"
43 #include "platform/geometry/IntSize.h" 43 #include "platform/geometry/IntSize.h"
44 #include "platform/graphics/CanvasSurfaceLayerBridge.h"
44 #include "platform/graphics/GraphicsTypes.h" 45 #include "platform/graphics/GraphicsTypes.h"
45 #include "platform/graphics/GraphicsTypes3D.h" 46 #include "platform/graphics/GraphicsTypes3D.h"
46 #include "platform/graphics/ImageBufferClient.h" 47 #include "platform/graphics/ImageBufferClient.h"
47 #include "platform/heap/Handle.h" 48 #include "platform/heap/Handle.h"
48 49
49 #define CanvasDefaultInterpolationQuality InterpolationLow 50 #define CanvasDefaultInterpolationQuality InterpolationLow
50 51
51 namespace blink { 52 namespace blink {
52 53
53 class AffineTransform; 54 class AffineTransform;
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 191
191 void styleDidChange(const ComputedStyle* oldStyle, const ComputedStyle& newS tyle); 192 void styleDidChange(const ComputedStyle* oldStyle, const ComputedStyle& newS tyle);
192 193
193 void notifyListenersCanvasChanged(); 194 void notifyListenersCanvasChanged();
194 195
195 // For Canvas HitRegions 196 // For Canvas HitRegions
196 bool isSupportedInteractiveCanvasFallback(const Element&); 197 bool isSupportedInteractiveCanvasFallback(const Element&);
197 std::pair<Element*, String> getControlAndIdIfHitRegionExists(const LayoutPoi nt&); 198 std::pair<Element*, String> getControlAndIdIfHitRegionExists(const LayoutPoi nt&);
198 String getIdFromControl(const Element*); 199 String getIdFromControl(const Element*);
199 200
201 // For OffscreenCanvas that controls this html canvas element
202 CanvasSurfaceLayerBridge* surfaceLayerBridge() const { return m_surfaceLayer Bridge.get(); }
203 void createSurfaceLayerBridge();
204
200 protected: 205 protected:
201 void didMoveToNewDocument(Document& oldDocument) override; 206 void didMoveToNewDocument(Document& oldDocument) override;
202 207
203 private: 208 private:
204 explicit HTMLCanvasElement(Document&); 209 explicit HTMLCanvasElement(Document&);
205 210
206 using ContextFactoryVector = Vector<OwnPtr<CanvasRenderingContextFactory>>; 211 using ContextFactoryVector = Vector<OwnPtr<CanvasRenderingContextFactory>>;
207 static ContextFactoryVector& renderingContextFactories(); 212 static ContextFactoryVector& renderingContextFactories();
208 static CanvasRenderingContextFactory* getRenderingContextFactory(int); 213 static CanvasRenderingContextFactory* getRenderingContextFactory(int);
209 214
(...skipping 29 matching lines...) Expand all
239 244
240 bool m_originClean; 245 bool m_originClean;
241 246
242 // It prevents HTMLCanvasElement::buffer() from continuously re-attempting t o allocate an imageBuffer 247 // It prevents HTMLCanvasElement::buffer() from continuously re-attempting t o allocate an imageBuffer
243 // after the first attempt failed. 248 // after the first attempt failed.
244 mutable bool m_didFailToCreateImageBuffer; 249 mutable bool m_didFailToCreateImageBuffer;
245 bool m_imageBufferIsClear; 250 bool m_imageBufferIsClear;
246 OwnPtr<ImageBuffer> m_imageBuffer; 251 OwnPtr<ImageBuffer> m_imageBuffer;
247 252
248 mutable RefPtr<Image> m_copiedImage; // FIXME: This is temporary for platfor ms that have to copy the image buffer to render (and for CSSCanvasValue). 253 mutable RefPtr<Image> m_copiedImage; // FIXME: This is temporary for platfor ms that have to copy the image buffer to render (and for CSSCanvasValue).
254
255 // Used for OffscreenCanvas that controls this HTML canvas element
256 OwnPtr<CanvasSurfaceLayerBridge> m_surfaceLayerBridge;
249 }; 257 };
250 258
251 } // namespace blink 259 } // namespace blink
252 260
253 #endif // HTMLCanvasElement_h 261 #endif // HTMLCanvasElement_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698