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

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

Issue 1257253004: [HTMLCanvasElement.toBlob] Default callback version without scheduler (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Basic Callback version of toBlob function of HTMLCanvasElement Implemented Created 5 years, 4 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 25 matching lines...) Expand all
36 #include "platform/graphics/GraphicsTypes3D.h" 36 #include "platform/graphics/GraphicsTypes3D.h"
37 #include "platform/graphics/ImageBufferSurface.h" 37 #include "platform/graphics/ImageBufferSurface.h"
38 #include "platform/graphics/paint/DisplayItemClient.h" 38 #include "platform/graphics/paint/DisplayItemClient.h"
39 #include "platform/transforms/AffineTransform.h" 39 #include "platform/transforms/AffineTransform.h"
40 #include "third_party/skia/include/core/SkPaint.h" 40 #include "third_party/skia/include/core/SkPaint.h"
41 #include "wtf/Forward.h" 41 #include "wtf/Forward.h"
42 #include "wtf/OwnPtr.h" 42 #include "wtf/OwnPtr.h"
43 #include "wtf/PassOwnPtr.h" 43 #include "wtf/PassOwnPtr.h"
44 #include "wtf/PassRefPtr.h" 44 #include "wtf/PassRefPtr.h"
45 #include "wtf/Uint8ClampedArray.h" 45 #include "wtf/Uint8ClampedArray.h"
46 #include "wtf/Vector.h"
47 #include "wtf/text/WTFString.h"
46 48
47 namespace WTF { 49 namespace WTF {
48 50
49 class ArrayBufferContents; 51 class ArrayBufferContents;
50 52
51 } // namespace WTF 53 } // namespace WTF
52 54
53 namespace blink { 55 namespace blink {
54 56
55 class DrawingBuffer; 57 class DrawingBuffer;
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 private: 141 private:
140 ImageBuffer(PassOwnPtr<ImageBufferSurface>); 142 ImageBuffer(PassOwnPtr<ImageBufferSurface>);
141 143
142 OwnPtr<ImageBufferSurface> m_surface; 144 OwnPtr<ImageBufferSurface> m_surface;
143 ImageBufferClient* m_client; 145 ImageBufferClient* m_client;
144 }; 146 };
145 147
146 struct ImageDataBuffer { 148 struct ImageDataBuffer {
147 ImageDataBuffer(const IntSize& size, unsigned char* data) : m_data(data), m_ size(size) { } 149 ImageDataBuffer(const IntSize& size, unsigned char* data) : m_data(data), m_ size(size) { }
148 String PLATFORM_EXPORT toDataURL(const String& mimeType, const double* quali ty) const; 150 String PLATFORM_EXPORT toDataURL(const String& mimeType, const double* quali ty) const;
151 bool PLATFORM_EXPORT toDataVector(const String& mimeType, const double* qual ity, Vector<char>& encodedDataVector) const;
Justin Novosad 2015/08/13 21:03:40 encodedDataVector is an output param: should be pa
149 unsigned char* pixels() const { return m_data; } 152 unsigned char* pixels() const { return m_data; }
150 int height() const { return m_size.height(); } 153 int height() const { return m_size.height(); }
151 int width() const { return m_size.width(); } 154 int width() const { return m_size.width(); }
152 unsigned char* m_data; 155 unsigned char* m_data;
153 IntSize m_size; 156 IntSize m_size;
154 }; 157 };
155 158
156 } // namespace blink 159 } // namespace blink
157 160
158 #endif // ImageBuffer_h 161 #endif // ImageBuffer_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698