| 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 | 68 |
| 69 enum Multiply { | 69 enum Multiply { |
| 70 Premultiplied, | 70 Premultiplied, |
| 71 Unmultiplied | 71 Unmultiplied |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 class PLATFORM_EXPORT ImageBuffer { | 74 class PLATFORM_EXPORT ImageBuffer { |
| 75 WTF_MAKE_NONCOPYABLE(ImageBuffer); | 75 WTF_MAKE_NONCOPYABLE(ImageBuffer); |
| 76 USING_FAST_MALLOC(ImageBuffer); | 76 USING_FAST_MALLOC(ImageBuffer); |
| 77 public: | 77 public: |
| 78 static std::unique_ptr<ImageBuffer> create(const IntSize&, OpacityMode = Non
Opaque, ImageInitializationMode = InitializeImagePixels); | 78 static std::unique_ptr<ImageBuffer> create(const IntSize&, OpacityMode = Non
Opaque, ImageInitializationMode = InitializeImagePixels, sk_sp<SkColorSpace> = n
ullptr); |
| 79 static std::unique_ptr<ImageBuffer> create(std::unique_ptr<ImageBufferSurfac
e>); | 79 static std::unique_ptr<ImageBuffer> create(std::unique_ptr<ImageBufferSurfac
e>); |
| 80 | 80 |
| 81 virtual ~ImageBuffer(); | 81 virtual ~ImageBuffer(); |
| 82 | 82 |
| 83 void setClient(ImageBufferClient* client) { m_client = client; } | 83 void setClient(ImageBufferClient* client) { m_client = client; } |
| 84 | 84 |
| 85 static bool canCreateImageBuffer(const IntSize&); | 85 static bool canCreateImageBuffer(const IntSize&); |
| 86 const IntSize& size() const { return m_surface->size(); } | 86 const IntSize& size() const { return m_surface->size(); } |
| 87 bool isAccelerated() const { return m_surface->isAccelerated(); } | 87 bool isAccelerated() const { return m_surface->isAccelerated(); } |
| 88 bool isRecording() const { return m_surface->isRecording(); } | 88 bool isRecording() const { return m_surface->isRecording(); } |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 int height() const { return m_size.height(); } | 179 int height() const { return m_size.height(); } |
| 180 int width() const { return m_size.width(); } | 180 int width() const { return m_size.width(); } |
| 181 | 181 |
| 182 const unsigned char* m_data; | 182 const unsigned char* m_data; |
| 183 const IntSize m_size; | 183 const IntSize m_size; |
| 184 }; | 184 }; |
| 185 | 185 |
| 186 } // namespace blink | 186 } // namespace blink |
| 187 | 187 |
| 188 #endif // ImageBuffer_h | 188 #endif // ImageBuffer_h |
| OLD | NEW |