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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/ImageBuffer.h

Issue 1355333005: Implement Asynchronous image encoding for Canvas.toBlob (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change async func to static so no need worry if canvas instance does not live long enough Created 5 years, 2 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) 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 DidAcquireSnapshot, 147 DidAcquireSnapshot,
148 DrawnToAfterSnapshot, 148 DrawnToAfterSnapshot,
149 }; 149 };
150 mutable SnapshotState m_snapshotState; 150 mutable SnapshotState m_snapshotState;
151 OwnPtr<ImageBufferSurface> m_surface; 151 OwnPtr<ImageBufferSurface> m_surface;
152 ImageBufferClient* m_client; 152 ImageBufferClient* m_client;
153 }; 153 };
154 154
155 struct ImageDataBuffer { 155 struct ImageDataBuffer {
156 ImageDataBuffer(const IntSize& size, const unsigned char* data) : m_data(dat a), m_size(size) { } 156 ImageDataBuffer(const IntSize& size, const unsigned char* data) : m_data(dat a), m_size(size) { }
157 String PLATFORM_EXPORT toDataURL(const String& mimeType, const double* quali ty) const; 157 String PLATFORM_EXPORT toDataURL(const String& mimeType, const double& quali ty) const;
158 bool PLATFORM_EXPORT encodeImage(const String& mimeType, const double* quali ty, Vector<char>* output) const; 158 bool PLATFORM_EXPORT encodeImage(const String& mimeType, const double& quali ty, Vector<char>* output) const;
159 const unsigned char* pixels() const { return m_data; } 159 const unsigned char* pixels() const { return m_data; }
160 int height() const { return m_size.height(); } 160 int height() const { return m_size.height(); }
161 int width() const { return m_size.width(); } 161 int width() const { return m_size.width(); }
162 162
163 const unsigned char* m_data; 163 const unsigned char* m_data;
164 const IntSize m_size; 164 const IntSize m_size;
165 }; 165 };
166 166
167 } // namespace blink 167 } // namespace blink
168 168
169 #endif // ImageBuffer_h 169 #endif // ImageBuffer_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698