OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2012 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_IMAGE_H_ | |
6 #define CC_IMAGE_H_ | |
7 | |
8 #include "base/basictypes.h" | |
9 #include "base/memory/ref_counted.h" | |
10 #include "cc/cc_export.h" | |
11 #include "skia/ext/refptr.h" | |
12 #include "third_party/skia/include/core/SkPixelRef.h" | |
13 | |
14 namespace cc { | |
15 | |
16 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
| |
17 public: | |
18 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.
| |
19 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.
| |
20 bool PrepareToDecode(); | |
21 | |
22 SkPixelRef* pixel_ref() { return pixel_ref_.get(); } | |
23 | |
24 private: | |
25 explicit Image(const skia::RefPtr<SkPixelRef>&); | |
26 ~Image(); | |
27 | |
28 skia::RefPtr<SkPixelRef> pixel_ref_; | |
29 | |
30 friend class base::RefCountedThreadSafe<Image>; | |
31 DISALLOW_COPY_AND_ASSIGN(Image); | |
32 }; | |
33 | |
34 } // namespace cc | |
35 | |
36 #endif // CC_IMAGE_H_ | |
OLD | NEW |