Chromium Code Reviews| 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_UI_RESOURCE_BITMAP_H_ | |
| 6 #define CC_RESOURCES_UI_RESOURCE_BITMAP_H_ | |
| 7 | |
| 8 #include "base/memory/ref_counted.h" | |
| 9 #include "ui/gfx/size.h" | |
| 10 | |
| 11 namespace cc { | |
| 12 | |
| 13 // Ref-counted bitmap class (can’t use SkBitmap because of ETC1) | |
|
enne (OOO)
2013/07/22 23:09:15
Could you also mention why this needs to be thread
powei
2013/07/24 02:28:29
Done.
| |
| 14 class UIResourceBitmap : public base::RefCountedThreadSafe<UIResourceBitmap> { | |
| 15 public: | |
| 16 enum UIResourceFormat { | |
| 17 RGBA8, | |
| 18 ETC1 | |
|
enne (OOO)
2013/07/22 23:09:15
If ETC1 isn't handled yet, please don't include it
powei
2013/07/24 02:28:29
Done.
| |
| 19 }; | |
| 20 | |
| 21 // Takes ownership of “pixels”. | |
| 22 static scoped_refptr<UIResourceBitmap> Create(void* pixels, | |
|
aelias_OOO_until_Jul13
2013/07/23 00:06:48
Could these void* just be uint8_t* instead? Then
powei
2013/07/24 02:28:29
Done.
| |
| 23 UIResourceFormat format, | |
| 24 gfx::Size size); | |
| 25 | |
| 26 gfx::Size GetSize() const { return size_; } | |
| 27 UIResourceFormat GetFormat() const { return format_; } | |
| 28 void* GetPixels() { return pixels_.get(); } | |
| 29 | |
| 30 private: | |
| 31 scoped_ptr<uint8_t[]> pixels_; | |
| 32 UIResourceFormat format_; | |
| 33 gfx::Size size_; | |
| 34 }; | |
| 35 | |
| 36 } // namespace cc | |
| 37 | |
| 38 #endif // CC_RESOURCES_UI_RESOURCE_BITMAP_H_ | |
| OLD | NEW |