OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CC_RESOURCES_ETC1_PIXEL_REF_H_ | 5 #ifndef CC_RESOURCES_ETC1_PIXEL_REF_H_ |
6 #define CC_RESOURCES_ETC1_PIXEL_REF_H_ | 6 #define CC_RESOURCES_ETC1_PIXEL_REF_H_ |
7 | 7 |
8 #include "base/logging.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" |
9 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
10 #include "cc/base/cc_export.h" | 11 #include "cc/base/cc_export.h" |
11 #include "third_party/skia/include/core/SkBitmap.h" | |
12 #include "third_party/skia/include/core/SkFlattenable.h" | |
13 #include "third_party/skia/include/core/SkPixelRef.h" | 12 #include "third_party/skia/include/core/SkPixelRef.h" |
14 | 13 |
15 namespace cc { | 14 namespace cc { |
16 | 15 |
17 class CC_EXPORT ETC1PixelRef : public SkPixelRef { | 16 class CC_EXPORT ETC1PixelRef : public SkPixelRef { |
18 public: | 17 public: |
19 // Takes ownership of pixels. | 18 // Takes ownership of pixels. |
20 explicit ETC1PixelRef(scoped_ptr<uint8_t[]> pixels); | 19 explicit ETC1PixelRef(scoped_ptr<uint8_t[]> pixels); |
21 virtual ~ETC1PixelRef(); | 20 virtual ~ETC1PixelRef(); |
22 | 21 |
23 // SK_DECLARE_UNFLATTENABLE_OBJECT | 22 // SK_DECLARE_UNFLATTENABLE_OBJECT |
24 virtual Factory getFactory() const SK_OVERRIDE; | 23 virtual Factory getFactory() const OVERRIDE; |
25 | 24 |
26 protected: | 25 protected: |
27 // Implementation of SkPixelRef. | 26 // Implementation of SkPixelRef. |
28 virtual void* onLockPixels(SkColorTable** color_table) SK_OVERRIDE; | 27 virtual void* onLockPixels(SkColorTable** color_table) OVERRIDE; |
29 virtual void onUnlockPixels() SK_OVERRIDE; | 28 virtual void onUnlockPixels() OVERRIDE; |
30 | 29 |
31 private: | 30 private: |
32 scoped_ptr<uint8_t[]> pixels_; | 31 scoped_ptr<uint8_t[]> pixels_; |
| 32 |
| 33 DISALLOW_COPY_AND_ASSIGN(ETC1PixelRef); |
33 }; | 34 }; |
34 | 35 |
35 } // namespace cc | 36 } // namespace cc |
36 | 37 |
37 #endif // CC_RESOURCES_ETC1_PIXEL_REF_H_ | 38 #endif // CC_RESOURCES_ETC1_PIXEL_REF_H_ |
OLD | NEW |