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 #include "cc/resources/ui_resource_manager.h" | |
| 6 | |
| 7 namespace cc { | |
| 8 | |
| 9 scoped_refptr<UIResourceBitmap> | |
| 10 UIResourceBitmap::Create(void* pixels, | |
| 11 UIResourceFormat format, | |
| 12 gfx::Size size) { | |
| 13 scoped_refptr<UIResourceBitmap> ret = new UIResourceBitmap(); | |
| 14 ret->pixels_ = pixels; | |
| 15 ret->format_ = format; | |
| 16 ret->size_ = size; | |
| 17 | |
| 18 return ret; | |
| 19 } | |
| 20 | |
| 21 UIResourceBitmap::~UIResourceBitmap() { | |
| 22 // this class has ownership of the pixels | |
| 23 if (format_ == RGBA8) | |
| 24 delete [] reinterpret_cast<uint8_t*>(pixels_); | |
|
enne (OOO)
2013/07/09 17:57:48
Just make this a scoped_array<uint8_t>.
powei
2013/07/10 17:47:21
Can you elaborate on this? Are we assume that pix
tfarina
2013/07/10 23:30:45
this is spelled today as scoped_ptr<uint8_t[]>, se
| |
| 25 // handle other formats? | |
|
enne (OOO)
2013/07/09 17:57:48
You're probably going to need to handle BGRA or sw
| |
| 26 } | |
| 27 | |
| 28 | |
| 29 } // namespace cc | |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | |
| 52 | |
| 53 | |
| 54 | |
| 55 | |
| 56 | |
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | |
| 62 | |
| 63 | |
| 64 | |
| 65 | |
| 66 | |
| 67 | |
| 68 | |
| 69 | |
| 70 | |
| 71 | |
| 72 | |
| OLD | NEW |