OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef WebSkImage_h |
| 6 #define WebSkImage_h |
| 7 |
| 8 #include "WebPrivatePtr.h" |
| 9 #include "third_party/skia/include/core/SkImage.h" |
| 10 |
| 11 #if INSIDE_BLINK |
| 12 #include "wtf/Forward.h" |
| 13 #endif |
| 14 |
| 15 namespace blink { |
| 16 |
| 17 // A container for an SkImage |
| 18 class BLINK_PLATFORM_EXPORT WebSkImage { |
| 19 public: |
| 20 WebSkImage(); |
| 21 WebSkImage(const WebSkImage&); |
| 22 ~WebSkImage(); |
| 23 |
| 24 bool isNull() const { return m_image.isNull(); } |
| 25 int width() const; |
| 26 int height() const; |
| 27 bool readPixels(const SkImageInfo& dstInfo, |
| 28 void* dstPixels, |
| 29 size_t dstRowBytes, |
| 30 int srcX, |
| 31 int srcY) const; |
| 32 |
| 33 #if INSIDE_BLINK |
| 34 WebSkImage(const WTF::PassRefPtr<SkImage>&); |
| 35 WebSkImage& operator=(const WTF::PassRefPtr<SkImage>&); |
| 36 #endif |
| 37 private: |
| 38 WebPrivatePtr<SkImage> m_image; |
| 39 }; |
| 40 |
| 41 } // namespace blink |
| 42 |
| 43 #endif // WebSkImage_h |
OLD | NEW |