| 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/SkPixmap.h" | |
| 11 #include "wtf/Allocator.h" | 10 #include "wtf/Allocator.h" |
| 12 #include "wtf/Noncopyable.h" | 11 #include "wtf/Noncopyable.h" |
| 13 #include "wtf/PassRefPtr.h" | 12 #include "wtf/PassRefPtr.h" |
| 14 #include "wtf/RefPtr.h" | 13 #include "wtf/RefPtr.h" |
| 15 | 14 |
| 16 class SkImage; | 15 class SkImage; |
| 17 | 16 |
| 18 namespace blink { | 17 namespace blink { |
| 19 | 18 |
| 20 class ImagePixelLocker final { | 19 class ImagePixelLocker final { |
| 21 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); | 20 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); |
| 22 WTF_MAKE_NONCOPYABLE(ImagePixelLocker); | 21 WTF_MAKE_NONCOPYABLE(ImagePixelLocker); |
| 23 public: | 22 public: |
| 24 ImagePixelLocker(PassRefPtr<const SkImage>, SkAlphaType, SkColorType); | 23 ImagePixelLocker(PassRefPtr<const SkImage>, SkAlphaType, SkColorType); |
| 25 | 24 |
| 26 const void* pixels() const { return m_pixels; } | 25 const void* pixels() const { return m_pixels; } |
| 27 | 26 |
| 28 private: | 27 private: |
| 29 const RefPtr<const SkImage> m_image; | 28 const RefPtr<const SkImage> m_image; |
| 30 const void* m_pixels; | 29 const void* m_pixels; |
| 31 SkAutoMalloc m_pixelStorage; | 30 SkAutoMalloc m_pixelStorage; |
| 32 }; | 31 }; |
| 33 | 32 |
| 34 } // namespace blink | 33 } // namespace blink |
| 35 | 34 |
| 36 #endif | 35 #endif |
| OLD | NEW |