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

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

Issue 1361043003: Revert of Make 2D canvas smarter about chosing whether or not to use GPU acceleration (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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
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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 125
126 SkCanvas* drawingCanvas() const; 126 SkCanvas* drawingCanvas() const;
127 void disableDeferral() const; 127 void disableDeferral() const;
128 SkCanvas* existingDrawingCanvas() const; 128 SkCanvas* existingDrawingCanvas() const;
129 129
130 void setRenderingContext(PassOwnPtrWillBeRawPtr<CanvasRenderingContext>); 130 void setRenderingContext(PassOwnPtrWillBeRawPtr<CanvasRenderingContext>);
131 CanvasRenderingContext* renderingContext() const { return m_context.get(); } 131 CanvasRenderingContext* renderingContext() const { return m_context.get(); }
132 132
133 void ensureUnacceleratedImageBuffer(); 133 void ensureUnacceleratedImageBuffer();
134 ImageBuffer* buffer() const; 134 ImageBuffer* buffer() const;
135 PassRefPtr<Image> copiedImage(SourceDrawingBuffer, AccelerationHint) const; 135 PassRefPtr<Image> copiedImage(SourceDrawingBuffer) const;
136 void clearCopiedImage(); 136 void clearCopiedImage();
137 137
138 SecurityOrigin* securityOrigin() const; 138 SecurityOrigin* securityOrigin() const;
139 bool originClean() const; 139 bool originClean() const;
140 void setOriginTainted() { m_originClean = false; } 140 void setOriginTainted() { m_originClean = false; }
141 141
142 AffineTransform baseTransform() const; 142 AffineTransform baseTransform() const;
143 143
144 bool is3D() const; 144 bool is3D() const;
145 bool isAnimated2D() const; 145 bool isAnimated2D() const;
146 146
147 bool hasImageBuffer() const { return m_imageBuffer; } 147 bool hasImageBuffer() const { return m_imageBuffer; }
148 void discardImageBuffer(); 148 void discardImageBuffer();
149 149
150 bool shouldAccelerate(const IntSize&) const; 150 bool shouldAccelerate(const IntSize&) const;
151 151
152 bool shouldBeDirectComposited() const; 152 bool shouldBeDirectComposited() const;
153 153
154 void prepareSurfaceForPaintingIfNeeded() const;
155
156 const AtomicString imageSourceURL() const override; 154 const AtomicString imageSourceURL() const override;
157 155
158 InsertionNotificationRequest insertedInto(ContainerNode*) override; 156 InsertionNotificationRequest insertedInto(ContainerNode*) override;
159 157
160 // DocumentVisibilityObserver implementation 158 // DocumentVisibilityObserver implementation
161 void didChangeVisibilityState(PageVisibilityState) override; 159 void didChangeVisibilityState(PageVisibilityState) override;
162 160
163 // CanvasImageSource implementation 161 // CanvasImageSource implementation
164 PassRefPtr<Image> getSourceImageForCanvas(SourceImageStatus*, AccelerationHi nt) const override; 162 PassRefPtr<Image> getSourceImageForCanvas(SourceImageStatus*) const override ;
165 bool wouldTaintOrigin(SecurityOrigin*) const override; 163 bool wouldTaintOrigin(SecurityOrigin*) const override;
166 FloatSize elementSize() const override; 164 FloatSize elementSize() const override;
167 bool isCanvasElement() const override { return true; } 165 bool isCanvasElement() const override { return true; }
168 bool isOpaque() const override; 166 bool isOpaque() const override;
169 167
170 // ImageBufferClient implementation 168 // ImageBufferClient implementation
171 void notifySurfaceInvalid() override; 169 void notifySurfaceInvalid() override;
172 bool isDirty() override { return !m_dirtyRect.isEmpty(); } 170 bool isDirty() override { return !m_dirtyRect.isEmpty(); }
173 void didFinalizeFrame() override; 171 void didFinalizeFrame() override;
174 void restoreCanvasMatrixClipStack(SkCanvas*) const override; 172 void restoreCanvasMatrixClipStack(SkCanvas*) const override;
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 mutable bool m_didFailToCreateImageBuffer; 230 mutable bool m_didFailToCreateImageBuffer;
233 bool m_imageBufferIsClear; 231 bool m_imageBufferIsClear;
234 OwnPtr<ImageBuffer> m_imageBuffer; 232 OwnPtr<ImageBuffer> m_imageBuffer;
235 233
236 mutable RefPtr<Image> m_copiedImage; // FIXME: This is temporary for platfor ms that have to copy the image buffer to render (and for CSSCanvasValue). 234 mutable RefPtr<Image> m_copiedImage; // FIXME: This is temporary for platfor ms that have to copy the image buffer to render (and for CSSCanvasValue).
237 }; 235 };
238 236
239 } // namespace blink 237 } // namespace blink
240 238
241 #endif // HTMLCanvasElement_h 239 #endif // HTMLCanvasElement_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/ImageBitmap.cpp ('k') | third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698