| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CC_RESOURCES_ETC1_PIXEL_REF_H_ | |
| 6 #define CC_RESOURCES_ETC1_PIXEL_REF_H_ | |
| 7 | |
| 8 #include "base/basictypes.h" | |
| 9 #include "base/compiler_specific.h" | |
| 10 #include "base/memory/scoped_ptr.h" | |
| 11 #include "cc/base/cc_export.h" | |
| 12 #include "third_party/skia/include/core/SkPixelRef.h" | |
| 13 | |
| 14 namespace cc { | |
| 15 | |
| 16 class CC_EXPORT ETC1PixelRef : public SkPixelRef { | |
| 17 public: | |
| 18 // Takes ownership of pixels. | |
| 19 ETC1PixelRef(const SkImageInfo& info, size_t rowBytes, | |
| 20 scoped_ptr<uint8_t[]> pixels); | |
| 21 virtual ~ETC1PixelRef(); | |
| 22 | |
| 23 // SK_DECLARE_UNFLATTENABLE_OBJECT | |
| 24 virtual Factory getFactory() const OVERRIDE; | |
| 25 | |
| 26 protected: | |
| 27 // Implementation of SkPixelRef. | |
| 28 #ifdef SK_SUPPORT_LEGACY_ONLOCKPIXELS | |
| 29 virtual void* onLockPixels(SkColorTable** color_table) OVERRIDE; | |
| 30 #endif | |
| 31 virtual bool onNewLockPixels(LockRec* rec) OVERRIDE; | |
| 32 virtual void onUnlockPixels() OVERRIDE; | |
| 33 | |
| 34 private: | |
| 35 size_t rowBytes_; | |
| 36 scoped_ptr<uint8_t[]> pixels_; | |
| 37 | |
| 38 DISALLOW_COPY_AND_ASSIGN(ETC1PixelRef); | |
| 39 }; | |
| 40 | |
| 41 } // namespace cc | |
| 42 | |
| 43 #endif // CC_RESOURCES_ETC1_PIXEL_REF_H_ | |
| OLD | NEW |