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

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

Issue 758493004: canvas: make a temporary buffer when a context doesn't exist. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rename to isPaintable() Created 6 years 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 if (newSize == size()) 94 if (newSize == size())
95 return; 95 return;
96 m_ignoreReset = true; 96 m_ignoreReset = true;
97 setWidth(newSize.width()); 97 setWidth(newSize.width());
98 setHeight(newSize.height()); 98 setHeight(newSize.height());
99 m_ignoreReset = false; 99 m_ignoreReset = false;
100 reset(); 100 reset();
101 } 101 }
102 102
103 CanvasRenderingContext* getContext(const String&, CanvasContextAttributes* a ttributes = 0); 103 CanvasRenderingContext* getContext(const String&, CanvasContextAttributes* a ttributes = 0);
104 bool isPaintable() const;
104 105
105 static String toEncodingMimeType(const String& mimeType); 106 static String toEncodingMimeType(const String& mimeType);
106 String toDataURL(const String& mimeType, const double* quality, ExceptionSta te&) const; 107 String toDataURL(const String& mimeType, const double* quality, ExceptionSta te&) const;
107 String toDataURL(const String& mimeType, ExceptionState& exceptionState) con st { return toDataURL(mimeType, 0, exceptionState); } 108 String toDataURL(const String& mimeType, ExceptionState& exceptionState) con st { return toDataURL(mimeType, 0, exceptionState); }
108 109
109 // Used for rendering 110 // Used for rendering
110 void didDraw(const FloatRect&); 111 void didDraw(const FloatRect&);
111 void notifyObserversCanvasChanged(const FloatRect&); 112 void notifyObserversCanvasChanged(const FloatRect&);
112 113
113 void paint(GraphicsContext*, const LayoutRect&); 114 void paint(GraphicsContext*, const LayoutRect&);
114 115
115 GraphicsContext* drawingContext() const; 116 GraphicsContext* drawingContext() const;
116 GraphicsContext* existingDrawingContext() const; 117 GraphicsContext* existingDrawingContext() const;
117 118
118 CanvasRenderingContext* renderingContext() const { return m_context.get(); } 119 CanvasRenderingContext* renderingContext() const { return m_context.get(); }
119 120
120 void ensureUnacceleratedImageBuffer(); 121 void ensureUnacceleratedImageBuffer();
121 ImageBuffer* buffer() const; 122 ImageBuffer* buffer() const;
122 Image* copiedImage(SourceDrawingBuffer) const; 123 PassRefPtr<Image> copiedImage(SourceDrawingBuffer) const;
123 void clearCopiedImage(); 124 void clearCopiedImage();
124 125
125 SecurityOrigin* securityOrigin() const; 126 SecurityOrigin* securityOrigin() const;
126 bool originClean() const { return m_originClean; } 127 bool originClean() const { return m_originClean; }
127 void setOriginTainted() { m_originClean = false; } 128 void setOriginTainted() { m_originClean = false; }
128 129
129 AffineTransform baseTransform() const; 130 AffineTransform baseTransform() const;
130 131
131 bool is3D() const; 132 bool is3D() const;
132 133
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 bool m_imageBufferIsClear; 209 bool m_imageBufferIsClear;
209 OwnPtr<ImageBuffer> m_imageBuffer; 210 OwnPtr<ImageBuffer> m_imageBuffer;
210 mutable OwnPtr<GraphicsContextStateSaver> m_contextStateSaver; 211 mutable OwnPtr<GraphicsContextStateSaver> m_contextStateSaver;
211 212
212 mutable RefPtr<Image> m_copiedImage; // FIXME: This is temporary for platfor ms that have to copy the image buffer to render (and for CSSCanvasValue). 213 mutable RefPtr<Image> m_copiedImage; // FIXME: This is temporary for platfor ms that have to copy the image buffer to render (and for CSSCanvasValue).
213 }; 214 };
214 215
215 } // namespace blink 216 } // namespace blink
216 217
217 #endif // HTMLCanvasElement_h 218 #endif // HTMLCanvasElement_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698