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

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

Issue 255563004: Implement "Save image as" for canvas (blink side). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 8 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 107
108 GraphicsContext* drawingContext() const; 108 GraphicsContext* drawingContext() const;
109 GraphicsContext* existingDrawingContext() const; 109 GraphicsContext* existingDrawingContext() const;
110 110
111 CanvasRenderingContext* renderingContext() const { return m_context.get(); } 111 CanvasRenderingContext* renderingContext() const { return m_context.get(); }
112 112
113 void ensureUnacceleratedImageBuffer(); 113 void ensureUnacceleratedImageBuffer();
114 ImageBuffer* buffer() const; 114 ImageBuffer* buffer() const;
115 Image* copiedImage() const; 115 Image* copiedImage() const;
116 void clearCopiedImage(); 116 void clearCopiedImage();
117 PassRefPtrWillBeRawPtr<ImageData> getImageData(); 117 PassRefPtrWillBeRawPtr<ImageData> getImageData() const;
118 void makePresentationCopy(); 118 void makePresentationCopy();
119 void clearPresentationCopy(); 119 void clearPresentationCopy();
120 120
121 SecurityOrigin* securityOrigin() const; 121 SecurityOrigin* securityOrigin() const;
122 bool originClean() const { return m_originClean; } 122 bool originClean() const { return m_originClean; }
123 void setOriginTainted() { m_originClean = false; } 123 void setOriginTainted() { m_originClean = false; }
124 124
125 AffineTransform baseTransform() const; 125 AffineTransform baseTransform() const;
126 126
127 bool is3D() const; 127 bool is3D() const;
128 128
129 bool hasImageBuffer() const { return m_imageBuffer; } 129 bool hasImageBuffer() const { return m_imageBuffer; }
130 bool hasValidImageBuffer() const; 130 bool hasValidImageBuffer() const;
131 void discardImageBuffer(); 131 void discardImageBuffer();
132 132
133 bool shouldAccelerate(const IntSize&) const; 133 bool shouldAccelerate(const IntSize&) const;
134 134
135 virtual const AtomicString imageSourceURL() const OVERRIDE;
136
135 virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE; 137 virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE;
136 138
137 // DocumentVisibilityObserver implementation 139 // DocumentVisibilityObserver implementation
138 virtual void didChangeVisibilityState(PageVisibilityState) OVERRIDE; 140 virtual void didChangeVisibilityState(PageVisibilityState) OVERRIDE;
139 141
140 // CanvasImageSource implementation 142 // CanvasImageSource implementation
141 virtual PassRefPtr<Image> getSourceImageForCanvas(SourceImageMode, SourceIma geStatus*) const OVERRIDE; 143 virtual PassRefPtr<Image> getSourceImageForCanvas(SourceImageMode, SourceIma geStatus*) const OVERRIDE;
142 virtual bool wouldTaintOrigin(SecurityOrigin*) const OVERRIDE; 144 virtual bool wouldTaintOrigin(SecurityOrigin*) const OVERRIDE;
143 virtual FloatSize sourceSize() const OVERRIDE; 145 virtual FloatSize sourceSize() const OVERRIDE;
144 146
(...skipping 16 matching lines...) Expand all
161 void createImageBuffer(); 163 void createImageBuffer();
162 void createImageBufferInternal(); 164 void createImageBufferInternal();
163 void clearImageBuffer(); 165 void clearImageBuffer();
164 166
165 void setSurfaceSize(const IntSize&); 167 void setSurfaceSize(const IntSize&);
166 168
167 bool paintsIntoCanvasBuffer() const; 169 bool paintsIntoCanvasBuffer() const;
168 170
169 void updateExternallyAllocatedMemory() const; 171 void updateExternallyAllocatedMemory() const;
170 172
173 String toDataURLInternal(const String& mimeType, const double* quality) cons t;
174
171 HashSet<CanvasObserver*> m_observers; 175 HashSet<CanvasObserver*> m_observers;
172 176
173 IntSize m_size; 177 IntSize m_size;
174 178
175 OwnPtr<CanvasRenderingContext> m_context; 179 OwnPtr<CanvasRenderingContext> m_context;
176 180
177 bool m_rendererIsCanvas; 181 bool m_rendererIsCanvas;
178 182
179 bool m_ignoreReset; 183 bool m_ignoreReset;
180 bool m_accelerationDisabled; 184 bool m_accelerationDisabled;
(...skipping 10 matching lines...) Expand all
191 OwnPtr<ImageBuffer> m_imageBuffer; 195 OwnPtr<ImageBuffer> m_imageBuffer;
192 mutable OwnPtr<GraphicsContextStateSaver> m_contextStateSaver; 196 mutable OwnPtr<GraphicsContextStateSaver> m_contextStateSaver;
193 197
194 mutable RefPtr<Image> m_presentedImage; 198 mutable RefPtr<Image> m_presentedImage;
195 mutable RefPtr<Image> m_copiedImage; // FIXME: This is temporary for platfor ms that have to copy the image buffer to render (and for CSSCanvasValue). 199 mutable RefPtr<Image> m_copiedImage; // FIXME: This is temporary for platfor ms that have to copy the image buffer to render (and for CSSCanvasValue).
196 }; 200 };
197 201
198 } //namespace 202 } //namespace
199 203
200 #endif 204 #endif
OLDNEW
« no previous file with comments | « no previous file | Source/core/html/HTMLCanvasElement.cpp » ('j') | Source/core/html/HTMLCanvasElement.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698