Chromium Code Reviews| Index: cc/image.h |
| diff --git a/cc/image.h b/cc/image.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..3c9faaeed72c221e56c765af1a301563ef37228c |
| --- /dev/null |
| +++ b/cc/image.h |
| @@ -0,0 +1,36 @@ |
| +// Copyright 2012 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_IMAGE_H_ |
| +#define CC_IMAGE_H_ |
| + |
| +#include "base/basictypes.h" |
| +#include "base/memory/ref_counted.h" |
| +#include "cc/cc_export.h" |
| +#include "skia/ext/refptr.h" |
| +#include "third_party/skia/include/core/SkPixelRef.h" |
| + |
| +namespace cc { |
| + |
| +class CC_EXPORT Image : public base::RefCountedThreadSafe<Image> { |
|
reveman
2012/12/05 19:48:46
Does this need thread safe ref counting?
qinmin
2012/12/07 05:06:28
Not necessarily, just to ensure when passing it to
|
| +public: |
| + static scoped_refptr<Image> Create(SkPixelRef* pixel_ref); |
|
reveman
2012/12/05 19:48:46
nit: maybe a blank line between static and normal
qinmin
2012/12/07 05:06:28
Done.
|
| + void Decode(); |
|
Alpha Left Google
2012/12/05 20:24:28
Need some comments here.
Decode() is to populate
qinmin
2012/12/07 05:06:28
Done.
|
| + bool PrepareToDecode(); |
| + |
| + SkPixelRef* pixel_ref() { return pixel_ref_.get(); } |
| + |
| +private: |
| + explicit Image(const skia::RefPtr<SkPixelRef>&); |
| + ~Image(); |
| + |
| + skia::RefPtr<SkPixelRef> pixel_ref_; |
| + |
| + friend class base::RefCountedThreadSafe<Image>; |
| + DISALLOW_COPY_AND_ASSIGN(Image); |
| +}; |
| + |
| +} // namespace cc |
| + |
| +#endif // CC_IMAGE_H_ |