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

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

Issue 907453003: Move overdraw tracking code from GraphicsContext to CanvasRenderingContext2D (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix test copypasta Created 5 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/core.gypi ('k') | 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 virtual InsertionNotificationRequest insertedInto(ContainerNode*) override; 148 virtual InsertionNotificationRequest insertedInto(ContainerNode*) override;
149 149
150 // DocumentVisibilityObserver implementation 150 // DocumentVisibilityObserver implementation
151 virtual void didChangeVisibilityState(PageVisibilityState) override; 151 virtual void didChangeVisibilityState(PageVisibilityState) override;
152 152
153 // CanvasImageSource implementation 153 // CanvasImageSource implementation
154 virtual PassRefPtr<Image> getSourceImageForCanvas(SourceImageMode, SourceIma geStatus*) const override; 154 virtual PassRefPtr<Image> getSourceImageForCanvas(SourceImageMode, SourceIma geStatus*) const override;
155 virtual bool wouldTaintOrigin(SecurityOrigin*) const override; 155 virtual bool wouldTaintOrigin(SecurityOrigin*) const override;
156 virtual FloatSize sourceSize() const override; 156 virtual FloatSize sourceSize() const override;
157 virtual bool isCanvasElement() const override { return true; } 157 virtual bool isCanvasElement() const override { return true; }
158 virtual bool isOpaque() const override;
158 159
159 // ImageBufferClient implementation 160 // ImageBufferClient implementation
160 virtual void notifySurfaceInvalid() override; 161 virtual void notifySurfaceInvalid() override;
161 virtual bool isDirty() override { return !m_dirtyRect.isEmpty(); } 162 virtual bool isDirty() override { return !m_dirtyRect.isEmpty(); }
162 virtual void didFinalizeFrame() override; 163 virtual void didFinalizeFrame() override;
163 virtual void restoreCanvasMatrixClipStack() override; 164 virtual void restoreCanvasMatrixClipStack() override;
164 165
165 void doDeferredPaintInvalidation(); 166 void doDeferredPaintInvalidation();
166 167
167 virtual void trace(Visitor*) override; 168 virtual void trace(Visitor*) override;
168 169
170 // Methods used for testing
171 void createImageBufferUsingSurface(PassOwnPtr<ImageBufferSurface>);
172
169 protected: 173 protected:
170 virtual void didMoveToNewDocument(Document& oldDocument) override; 174 virtual void didMoveToNewDocument(Document& oldDocument) override;
171 175
172 private: 176 private:
173 explicit HTMLCanvasElement(Document&); 177 explicit HTMLCanvasElement(Document&);
174 178
175 virtual void parseAttribute(const QualifiedName&, const AtomicString&) overr ide; 179 virtual void parseAttribute(const QualifiedName&, const AtomicString&) overr ide;
176 virtual LayoutObject* createRenderer(const RenderStyle&) override; 180 virtual LayoutObject* createRenderer(const RenderStyle&) override;
177 virtual void didRecalcStyle(StyleRecalcChange) override; 181 virtual void didRecalcStyle(StyleRecalcChange) override;
178 virtual bool areAuthorShadowsAllowed() const override { return false; } 182 virtual bool areAuthorShadowsAllowed() const override { return false; }
179 183
180 void reset(); 184 void reset();
181 185
182 PassOwnPtr<RecordingImageBufferFallbackSurfaceFactory> createSurfaceFactory( const IntSize& deviceSize, int* msaaSampleCount) const; 186 PassOwnPtr<RecordingImageBufferFallbackSurfaceFactory> createSurfaceFactory( const IntSize& deviceSize, int* msaaSampleCount) const;
183 PassOwnPtr<ImageBufferSurface> createImageBufferSurface(const IntSize& devic eSize, int* msaaSampleCount); 187 PassOwnPtr<ImageBufferSurface> createImageBufferSurface(const IntSize& devic eSize, int* msaaSampleCount);
184 void createImageBuffer(); 188 void createImageBuffer();
185 void createImageBufferInternal(); 189 void createImageBufferInternal(PassOwnPtr<ImageBufferSurface> externalSurfac e);
186 bool shouldUseDisplayList(const IntSize& deviceSize); 190 bool shouldUseDisplayList(const IntSize& deviceSize);
187 191
188 void setSurfaceSize(const IntSize&); 192 void setSurfaceSize(const IntSize&);
189 193
190 bool paintsIntoCanvasBuffer() const; 194 bool paintsIntoCanvasBuffer() const;
191 195
192 void updateExternallyAllocatedMemory() const; 196 void updateExternallyAllocatedMemory() const;
193 197
194 String toDataURLInternal(const String& mimeType, const double* quality, Sour ceDrawingBuffer) const; 198 String toDataURLInternal(const String& mimeType, const double* quality, Sour ceDrawingBuffer) const;
195 199
(...skipping 17 matching lines...) Expand all
213 bool m_imageBufferIsClear; 217 bool m_imageBufferIsClear;
214 OwnPtr<ImageBuffer> m_imageBuffer; 218 OwnPtr<ImageBuffer> m_imageBuffer;
215 mutable OwnPtr<GraphicsContextStateSaver> m_contextStateSaver; 219 mutable OwnPtr<GraphicsContextStateSaver> m_contextStateSaver;
216 220
217 mutable RefPtr<Image> m_copiedImage; // FIXME: This is temporary for platfor ms that have to copy the image buffer to render (and for CSSCanvasValue). 221 mutable RefPtr<Image> m_copiedImage; // FIXME: This is temporary for platfor ms that have to copy the image buffer to render (and for CSSCanvasValue).
218 }; 222 };
219 223
220 } // namespace blink 224 } // namespace blink
221 225
222 #endif // HTMLCanvasElement_h 226 #endif // HTMLCanvasElement_h
OLDNEW
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/html/HTMLCanvasElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698