| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> |
| 3 * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved. | 3 * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved. |
| 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 void didDraw(const FloatRect& rect) const { m_surface->didDraw(rect); } | 95 void didDraw(const FloatRect& rect) const { m_surface->didDraw(rect); } |
| 96 | 96 |
| 97 void setFilterQuality(SkFilterQuality filterQuality) { m_surface->setFilterQ
uality(filterQuality); } | 97 void setFilterQuality(SkFilterQuality filterQuality) { m_surface->setFilterQ
uality(filterQuality); } |
| 98 void setIsHidden(bool hidden) { m_surface->setIsHidden(hidden); } | 98 void setIsHidden(bool hidden) { m_surface->setIsHidden(hidden); } |
| 99 | 99 |
| 100 // Called by subclasses of ImageBufferSurface to install a new canvas object | 100 // Called by subclasses of ImageBufferSurface to install a new canvas object |
| 101 void resetCanvas(SkCanvas*); | 101 void resetCanvas(SkCanvas*); |
| 102 | 102 |
| 103 void willDrawVideo() { m_surface->willDrawVideo(); } | 103 void willDrawVideo() { m_surface->willDrawVideo(); } |
| 104 | 104 |
| 105 GraphicsContext* context() const; // Deprecated: use canvas() | |
| 106 SkCanvas* canvas() const; | 105 SkCanvas* canvas() const; |
| 107 | 106 |
| 108 // Called at the end of a task that rendered a whole frame | 107 // Called at the end of a task that rendered a whole frame |
| 109 void finalizeFrame(const FloatRect &dirtyRect); | 108 void finalizeFrame(const FloatRect &dirtyRect); |
| 110 void didFinalizeFrame(); | 109 void didFinalizeFrame(); |
| 111 | 110 |
| 112 bool isDirty(); | 111 bool isDirty(); |
| 113 | 112 |
| 114 const SkBitmap& bitmap() const; | 113 const SkBitmap& bitmap() const; |
| 115 | 114 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 | 150 |
| 152 private: | 151 private: |
| 153 ImageBuffer(PassOwnPtr<ImageBufferSurface>); | 152 ImageBuffer(PassOwnPtr<ImageBufferSurface>); |
| 154 | 153 |
| 155 void draw(GraphicsContext*, const FloatRect&, const FloatRect*, SkXfermode::
Mode); | 154 void draw(GraphicsContext*, const FloatRect&, const FloatRect*, SkXfermode::
Mode); |
| 156 | 155 |
| 157 friend class GraphicsContext; | 156 friend class GraphicsContext; |
| 158 friend class SkiaImageFilterBuilder; | 157 friend class SkiaImageFilterBuilder; |
| 159 | 158 |
| 160 OwnPtr<ImageBufferSurface> m_surface; | 159 OwnPtr<ImageBufferSurface> m_surface; |
| 161 OwnPtr<GraphicsContext> m_context; | |
| 162 ImageBufferClient* m_client; | 160 ImageBufferClient* m_client; |
| 163 }; | 161 }; |
| 164 | 162 |
| 165 struct ImageDataBuffer { | 163 struct ImageDataBuffer { |
| 166 ImageDataBuffer(const IntSize& size, unsigned char* data) : m_data(data), m_
size(size) { } | 164 ImageDataBuffer(const IntSize& size, unsigned char* data) : m_data(data), m_
size(size) { } |
| 167 String PLATFORM_EXPORT toDataURL(const String& mimeType, const double* quali
ty) const; | 165 String PLATFORM_EXPORT toDataURL(const String& mimeType, const double* quali
ty) const; |
| 168 unsigned char* pixels() const { return m_data; } | 166 unsigned char* pixels() const { return m_data; } |
| 169 int height() const { return m_size.height(); } | 167 int height() const { return m_size.height(); } |
| 170 int width() const { return m_size.width(); } | 168 int width() const { return m_size.width(); } |
| 171 unsigned char* m_data; | 169 unsigned char* m_data; |
| 172 IntSize m_size; | 170 IntSize m_size; |
| 173 }; | 171 }; |
| 174 | 172 |
| 175 } // namespace blink | 173 } // namespace blink |
| 176 | 174 |
| 177 #endif // ImageBuffer_h | 175 #endif // ImageBuffer_h |
| OLD | NEW |