| 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 | 112 |
| 113 Platform3DObject getBackingTexture(); | 113 Platform3DObject getBackingTexture(); |
| 114 bool copyRenderingResultsFromDrawingBuffer(DrawingBuffer*); | 114 bool copyRenderingResultsFromDrawingBuffer(DrawingBuffer*); |
| 115 | 115 |
| 116 void flush(); | 116 void flush(); |
| 117 | 117 |
| 118 private: | 118 private: |
| 119 ImageBuffer(PassOwnPtr<ImageBufferSurface>); | 119 ImageBuffer(PassOwnPtr<ImageBufferSurface>); |
| 120 bool isValid() const; | 120 bool isValid() const; |
| 121 | 121 |
| 122 void draw(GraphicsContext*, const FloatRect&, const FloatRect& = FloatRect(0
, 0, -1, -1), CompositeOperator = CompositeSourceOver, blink::WebBlendMode = bli
nk::WebBlendModeNormal, bool useLowQualityScale = false); | 122 void draw(GraphicsContext*, const FloatRect&, const FloatRect& = FloatRect(0
, 0, -1, -1), CompositeOperator = CompositeSourceOver, blink::WebBlendMode = bli
nk::WebBlendModeNormal, InterpolationQuality = InterpolationDefault); |
| 123 void drawPattern(GraphicsContext*, const FloatRect&, const FloatSize&, const
FloatPoint&, CompositeOperator, const FloatRect&, blink::WebBlendMode, const In
tSize& repeatSpacing = IntSize()); | 123 void drawPattern(GraphicsContext*, const FloatRect&, const FloatSize&, const
FloatPoint&, CompositeOperator, const FloatRect&, blink::WebBlendMode, const In
tSize& repeatSpacing = IntSize()); |
| 124 static PassRefPtr<SkColorFilter> createColorSpaceFilter(ColorSpace srcColorS
pace, ColorSpace dstColorSpace); | 124 static PassRefPtr<SkColorFilter> createColorSpaceFilter(ColorSpace srcColorS
pace, ColorSpace dstColorSpace); |
| 125 | 125 |
| 126 friend class GraphicsContext; | 126 friend class GraphicsContext; |
| 127 friend class GeneratedImage; | 127 friend class GeneratedImage; |
| 128 friend class CrossfadeGeneratedImage; | 128 friend class CrossfadeGeneratedImage; |
| 129 friend class GradientGeneratedImage; | 129 friend class GradientGeneratedImage; |
| 130 friend class SkiaImageFilterBuilder; | 130 friend class SkiaImageFilterBuilder; |
| 131 | 131 |
| 132 OwnPtr<ImageBufferSurface> m_surface; | 132 OwnPtr<ImageBufferSurface> m_surface; |
| 133 OwnPtr<GraphicsContext> m_context; | 133 OwnPtr<GraphicsContext> m_context; |
| 134 }; | 134 }; |
| 135 | 135 |
| 136 struct ImageDataBuffer { | 136 struct ImageDataBuffer { |
| 137 ImageDataBuffer(const IntSize& size, PassRefPtr<Uint8ClampedArray> data) : m
_size(size), m_data(data) { } | 137 ImageDataBuffer(const IntSize& size, PassRefPtr<Uint8ClampedArray> data) : m
_size(size), m_data(data) { } |
| 138 IntSize size() const { return m_size; } | 138 IntSize size() const { return m_size; } |
| 139 unsigned char* data() const { return m_data->data(); } | 139 unsigned char* data() const { return m_data->data(); } |
| 140 | 140 |
| 141 IntSize m_size; | 141 IntSize m_size; |
| 142 RefPtr<Uint8ClampedArray> m_data; | 142 RefPtr<Uint8ClampedArray> m_data; |
| 143 }; | 143 }; |
| 144 | 144 |
| 145 String PLATFORM_EXPORT ImageDataToDataURL(const ImageDataBuffer&, const String&
mimeType, const double* quality); | 145 String PLATFORM_EXPORT ImageDataToDataURL(const ImageDataBuffer&, const String&
mimeType, const double* quality); |
| 146 | 146 |
| 147 } // namespace WebCore | 147 } // namespace WebCore |
| 148 | 148 |
| 149 #endif // ImageBuffer_h | 149 #endif // ImageBuffer_h |
| OLD | NEW |