| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013, Google Inc. All rights reserved. | 2 * Copyright (c) 2013, Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "platform/graphics/ImageBufferSurface.h" | 31 #include "platform/graphics/ImageBufferSurface.h" |
| 32 | 32 |
| 33 #include "platform/graphics/GraphicsContext.h" | 33 #include "platform/graphics/GraphicsContext.h" |
| 34 #include "platform/graphics/ImageBuffer.h" | 34 #include "platform/graphics/ImageBuffer.h" |
| 35 #include "platform/graphics/StaticBitmapImage.h" | 35 #include "platform/graphics/StaticBitmapImage.h" |
| 36 #include "third_party/skia/include/core/SkColorSpace.h" |
| 36 #include "third_party/skia/include/core/SkImage.h" | 37 #include "third_party/skia/include/core/SkImage.h" |
| 37 | 38 |
| 38 class SkPicture; | 39 class SkPicture; |
| 39 | 40 |
| 40 namespace blink { | 41 namespace blink { |
| 41 | 42 |
| 42 ImageBufferSurface::ImageBufferSurface(const IntSize& size, OpacityMode opacityM
ode) | 43 ImageBufferSurface::ImageBufferSurface(const IntSize& size, OpacityMode opacityM
ode, sk_sp<SkColorSpace> colorSpace) |
| 43 : m_opacityMode(opacityMode) | 44 : m_opacityMode(opacityMode) |
| 44 , m_size(size) | 45 , m_size(size) |
| 46 , m_colorSpace(colorSpace) |
| 45 { | 47 { |
| 46 setIsHidden(false); | 48 setIsHidden(false); |
| 47 } | 49 } |
| 48 | 50 |
| 49 ImageBufferSurface::~ImageBufferSurface() { } | 51 ImageBufferSurface::~ImageBufferSurface() { } |
| 50 | 52 |
| 51 PassRefPtr<SkPicture> ImageBufferSurface::getPicture() | 53 PassRefPtr<SkPicture> ImageBufferSurface::getPicture() |
| 52 { | 54 { |
| 53 return nullptr; | 55 return nullptr; |
| 54 } | 56 } |
| (...skipping 27 matching lines...) Expand all Loading... |
| 82 { | 84 { |
| 83 canvas()->flush(); | 85 canvas()->flush(); |
| 84 } | 86 } |
| 85 | 87 |
| 86 bool ImageBufferSurface::writePixels(const SkImageInfo& origInfo, const void* pi
xels, size_t rowBytes, int x, int y) | 88 bool ImageBufferSurface::writePixels(const SkImageInfo& origInfo, const void* pi
xels, size_t rowBytes, int x, int y) |
| 87 { | 89 { |
| 88 return canvas()->writePixels(origInfo, pixels, rowBytes, x, y); | 90 return canvas()->writePixels(origInfo, pixels, rowBytes, x, y); |
| 89 } | 91 } |
| 90 | 92 |
| 91 } // namespace blink | 93 } // namespace blink |
| OLD | NEW |