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

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

Issue 1302423004: Support lossy and lossless <canvas>.toDataURL for webp (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Patch for landing. Created 5 years, 3 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
« no previous file with comments | « Source/platform/MIMETypeRegistry.cpp ('k') | Source/platform/graphics/ImageBuffer.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) 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 DrawnToAfterSnapshot, 147 DrawnToAfterSnapshot,
148 }; 148 };
149 mutable SnapshotState m_snapshotState; 149 mutable SnapshotState m_snapshotState;
150 OwnPtr<ImageBufferSurface> m_surface; 150 OwnPtr<ImageBufferSurface> m_surface;
151 ImageBufferClient* m_client; 151 ImageBufferClient* m_client;
152 }; 152 };
153 153
154 struct ImageDataBuffer { 154 struct ImageDataBuffer {
155 ImageDataBuffer(const IntSize& size, unsigned char* data) : m_data(data), m_ size(size) { } 155 ImageDataBuffer(const IntSize& size, unsigned char* data) : m_data(data), m_ size(size) { }
156 String PLATFORM_EXPORT toDataURL(const String& mimeType, const double* quali ty) const; 156 String PLATFORM_EXPORT toDataURL(const String& mimeType, const double* quali ty) const;
157 bool PLATFORM_EXPORT encodeImage(const String& mimeType, const double* quali ty, Vector<char>* output) const; 157 bool PLATFORM_EXPORT encodeImage(const String& mimeType, const double* quali ty, Vector<char>* output, String* outputMimeType) const;
158 unsigned char* pixels() const { return m_data; } 158 unsigned char* pixels() const { return m_data; }
159 int height() const { return m_size.height(); } 159 int height() const { return m_size.height(); }
160 int width() const { return m_size.width(); } 160 int width() const { return m_size.width(); }
161 unsigned char* m_data; 161 unsigned char* m_data;
162 IntSize m_size; 162 IntSize m_size;
163 }; 163 };
164 164
165 } // namespace blink 165 } // namespace blink
166 166
167 #endif // ImageBuffer_h 167 #endif // ImageBuffer_h
OLDNEW
« no previous file with comments | « Source/platform/MIMETypeRegistry.cpp ('k') | Source/platform/graphics/ImageBuffer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698