Chromium Code Reviews| Index: cc/resources/etc1_pixel_ref.h |
| diff --git a/cc/resources/etc1_pixel_ref.h b/cc/resources/etc1_pixel_ref.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..4231af891f0d6facef863afdbf9dae77b086dbf9 |
| --- /dev/null |
| +++ b/cc/resources/etc1_pixel_ref.h |
| @@ -0,0 +1,33 @@ |
| +// Copyright 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CC_RESOURCES_ETC1_PIXEL_REF_H_ |
| +#define CC_RESOURCES_ETC1_PIXEL_REF_H_ |
| + |
| +#include "base/logging.h" |
| +#include "base/memory/scoped_ptr.h" |
| +#include "third_party/skia/include/core/SkBitmap.h" |
| +#include "third_party/skia/include/core/SkPixelRef.h" |
| + |
| +namespace cc { |
| + |
| +class ETC1PixelRef : public SkPixelRef { |
| + public: |
| + // Takes ownership of pixels. |
| + explicit ETC1PixelRef(scoped_ptr<uint8_t[]> pixels); |
|
aelias_OOO_until_Jul13
2013/11/07 19:30:27
Could you also make this take a gfx::Size in the c
powei
2013/11/07 19:45:31
Then both UIResourceBitmap and this class will hol
|
| + virtual ~ETC1PixelRef() {} |
| + SK_DECLARE_UNFLATTENABLE_OBJECT() |
| + |
| + protected: |
| + // Implementation of SkPixelRef. |
| + virtual void* onLockPixels(SkColorTable** color_table) SK_OVERRIDE; |
| + virtual void onUnlockPixels() SK_OVERRIDE {} |
| + |
| + private: |
| + scoped_ptr<uint8_t[]> pixels_; |
| +}; |
| + |
| +} // namespace cc |
| + |
| +#endif // CC_RESOURCES_ETC1_PIXEL_REF_H_ |