Chromium Code Reviews| Index: cc/resources/ui_resource_manager.cc |
| =================================================================== |
| --- cc/resources/ui_resource_manager.cc (revision 0) |
| +++ cc/resources/ui_resource_manager.cc (revision 0) |
| @@ -0,0 +1,67 @@ |
| +// Copyright 2013 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. |
| + |
| +#include "cc/resources/ui_resource_manager.h" |
| + |
| +namespace cc { |
| + |
| +scoped_refptr<UIResourceBitmap> |
| +UIResourceBitmap::Create(void* pixels, |
| + UIResourceFormat format, |
| + gfx::Size size) { |
| + scoped_refptr<UIResourceBitmap> ret = new UIResourceBitmap(); |
| + ret->pixels_ = pixels; |
| + ret->format_ = format; |
| + ret->size_ = size; |
| + |
| + return ret; |
| +} |
| + |
| +UIResourceBitmap::~UIResourceBitmap() { |
| + // this class has ownership of the pixels |
| + if (format_ == RGBA8) |
| + delete [] reinterpret_cast<uint8_t*>(pixels_); |
|
aelias_OOO_until_Jul13
2013/07/10 23:07:22
There should be a way to do this with a scoped_ptr
powei
2013/07/11 23:54:44
Done.
|
| + |
| + // handle other formats? |
| +} |
| + |
| +} // namespace cc |
| + |
| + |
| + |
| + |
| + |
| + |
| + |
| + |
| + |
| + |
| + |
| + |
| + |
| + |
| + |
| + |
| + |
| + |
| + |
| + |
| + |
| + |
| + |
| + |
| + |
| + |
| + |
| + |
| + |
| + |
| + |
| + |
| + |
| + |
| + |
| + |
| + |
| + |