| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef ImagePixelLocker_h | 5 #ifndef ImagePixelLocker_h |
| 6 #define ImagePixelLocker_h | 6 #define ImagePixelLocker_h |
| 7 | 7 |
| 8 #include "platform/heap/Heap.h" | 8 #include "platform/heap/Heap.h" |
| 9 #include "third_party/skia/include/core/SkImageInfo.h" | 9 #include "third_party/skia/include/core/SkImageInfo.h" |
| 10 #include "third_party/skia/include/core/SkRefCnt.h" |
| 10 #include "wtf/Allocator.h" | 11 #include "wtf/Allocator.h" |
| 11 #include "wtf/Noncopyable.h" | 12 #include "wtf/Noncopyable.h" |
| 12 #include "wtf/PassRefPtr.h" | 13 #include "wtf/PassRefPtr.h" |
| 13 #include "wtf/RefPtr.h" | 14 #include "wtf/RefPtr.h" |
| 14 | 15 |
| 15 class SkImage; | 16 class SkImage; |
| 16 | 17 |
| 17 namespace blink { | 18 namespace blink { |
| 18 | 19 |
| 19 class ImagePixelLocker final { | 20 class ImagePixelLocker final { |
| 20 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); | 21 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); |
| 21 WTF_MAKE_NONCOPYABLE(ImagePixelLocker); | 22 WTF_MAKE_NONCOPYABLE(ImagePixelLocker); |
| 22 public: | 23 public: |
| 23 ImagePixelLocker(PassRefPtr<const SkImage>, SkAlphaType, SkColorType); | 24 ImagePixelLocker(sk_sp<const SkImage>, SkAlphaType, SkColorType); |
| 24 | 25 |
| 25 const void* pixels() const { return m_pixels; } | 26 const void* pixels() const { return m_pixels; } |
| 26 | 27 |
| 27 private: | 28 private: |
| 28 const RefPtr<const SkImage> m_image; | 29 const sk_sp<const SkImage> m_image; |
| 29 const void* m_pixels; | 30 const void* m_pixels; |
| 30 SkAutoMalloc m_pixelStorage; | 31 SkAutoMalloc m_pixelStorage; |
| 31 }; | 32 }; |
| 32 | 33 |
| 33 } // namespace blink | 34 } // namespace blink |
| 34 | 35 |
| 35 #endif | 36 #endif |
| OLD | NEW |