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,72 @@ |
+// 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_); |
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
|
+ // handle other formats? |
enne (OOO)
2013/07/09 17:57:48
You're probably going to need to handle BGRA or sw
|
+} |
+ |
+ |
+} // namespace cc |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |