Chromium Code Reviews| 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 25 matching lines...) Expand all Loading... | |
| 36 #include "platform/graphics/GraphicsTypes.h" | 36 #include "platform/graphics/GraphicsTypes.h" |
| 37 #include "platform/graphics/GraphicsTypes3D.h" | 37 #include "platform/graphics/GraphicsTypes3D.h" |
| 38 #include "platform/graphics/ImageBufferSurface.h" | 38 #include "platform/graphics/ImageBufferSurface.h" |
| 39 #include "platform/graphics/paint/DisplayItemList.h" | 39 #include "platform/graphics/paint/DisplayItemList.h" |
| 40 #include "platform/transforms/AffineTransform.h" | 40 #include "platform/transforms/AffineTransform.h" |
| 41 #include "third_party/skia/include/core/SkPaint.h" | 41 #include "third_party/skia/include/core/SkPaint.h" |
| 42 #include "wtf/Forward.h" | 42 #include "wtf/Forward.h" |
| 43 #include "wtf/OwnPtr.h" | 43 #include "wtf/OwnPtr.h" |
| 44 #include "wtf/PassOwnPtr.h" | 44 #include "wtf/PassOwnPtr.h" |
| 45 #include "wtf/PassRefPtr.h" | 45 #include "wtf/PassRefPtr.h" |
| 46 #include "wtf/Uint8ClampedArray.h" | |
| 47 | 46 |
| 48 namespace WTF { | 47 namespace WTF { |
| 49 | 48 |
| 50 class ArrayBufferContents; | 49 class ArrayBufferContents; |
| 51 | 50 |
| 52 } // namespace WTF | 51 } // namespace WTF |
| 53 | 52 |
| 54 namespace blink { | 53 namespace blink { |
| 55 | 54 |
| 56 class DrawingBuffer; | 55 class DrawingBuffer; |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 154 friend class CrossfadeGeneratedImage; | 153 friend class CrossfadeGeneratedImage; |
| 155 friend class GradientGeneratedImage; | 154 friend class GradientGeneratedImage; |
| 156 friend class SkiaImageFilterBuilder; | 155 friend class SkiaImageFilterBuilder; |
| 157 | 156 |
| 158 OwnPtr<ImageBufferSurface> m_surface; | 157 OwnPtr<ImageBufferSurface> m_surface; |
| 159 OwnPtr<GraphicsContext> m_context; | 158 OwnPtr<GraphicsContext> m_context; |
| 160 ImageBufferClient* m_client; | 159 ImageBufferClient* m_client; |
| 161 OwnPtr<DisplayItemList> m_displayItemList; | 160 OwnPtr<DisplayItemList> m_displayItemList; |
| 162 }; | 161 }; |
| 163 | 162 |
| 164 struct ImageDataBuffer { | 163 struct ImageDataBuffer : public IntSize { |
|
Yuki
2015/01/07 13:00:57
ImageDataBuffer is not a size. So we shouldn't in
Yuki
2015/01/07 14:42:06
It's simply because an image is not a size. An im
Yuki
2015/01/08 04:32:38
If ImageDataBuffer inherits from IntSize, ImageDat
| |
| 165 ImageDataBuffer(const IntSize& size, PassRefPtr<Uint8ClampedArray> data) : m _size(size), m_data(data) { } | 164 ImageDataBuffer(const IntSize& size, unsigned char* data) : IntSize(size), m _data(data) { } |
| 166 IntSize size() const { return m_size; } | 165 unsigned char* pixels() const { return m_data; } |
| 167 unsigned char* data() const { return m_data->data(); } | 166 unsigned char* m_data; |
| 168 | |
| 169 IntSize m_size; | |
| 170 RefPtr<Uint8ClampedArray> m_data; | |
| 171 }; | 167 }; |
| 172 | 168 |
| 173 String PLATFORM_EXPORT ImageDataToDataURL(const ImageDataBuffer&, const String& mimeType, const double* quality); | 169 String PLATFORM_EXPORT ImageDataToDataURL(const ImageDataBuffer&, const String& mimeType, const double* quality); |
| 174 | 170 |
| 175 } // namespace blink | 171 } // namespace blink |
| 176 | 172 |
| 177 #endif // ImageBuffer_h | 173 #endif // ImageBuffer_h |
| OLD | NEW |