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.
5 #ifndef CC_RESOURCES_ETC1_PIXEL_REF_H_
6 #define CC_RESOURCES_ETC1_PIXEL_REF_H_
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"
16 class CC_EXPORT ETC1PixelRef
: public SkPixelRef
{
18 // Takes ownership of pixels.
19 explicit ETC1PixelRef(scoped_ptr
<uint8_t[]> pixels
);
20 virtual ~ETC1PixelRef();
22 // SK_DECLARE_UNFLATTENABLE_OBJECT
23 virtual Factory
getFactory() const OVERRIDE
;
26 // Implementation of SkPixelRef.
27 virtual void* onLockPixels(SkColorTable
** color_table
) OVERRIDE
;
28 virtual void onUnlockPixels() OVERRIDE
;
31 scoped_ptr
<uint8_t[]> pixels_
;
33 DISALLOW_COPY_AND_ASSIGN(ETC1PixelRef
);
38 #endif // CC_RESOURCES_ETC1_PIXEL_REF_H_