Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2728)

Unified Diff: cc/resources/ui_resource_bitmap.h

Issue 18191020: UI Resource Manager (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: cc/resources/ui_resource_bitmap.h
===================================================================
--- cc/resources/ui_resource_bitmap.h (revision 0)
+++ cc/resources/ui_resource_bitmap.h (revision 0)
@@ -0,0 +1,38 @@
+// 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.
+
+#ifndef CC_RESOURCES_UI_RESOURCE_BITMAP_H_
+#define CC_RESOURCES_UI_RESOURCE_BITMAP_H_
+
+#include "base/memory/ref_counted.h"
+#include "ui/gfx/size.h"
+
+namespace cc {
+
+// 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.
+class UIResourceBitmap : public base::RefCountedThreadSafe<UIResourceBitmap> {
+ public:
+ enum UIResourceFormat {
+ RGBA8,
+ 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.
+ };
+
+ // Takes ownership of “pixels”.
+ 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.
+ UIResourceFormat format,
+ gfx::Size size);
+
+ gfx::Size GetSize() const { return size_; }
+ UIResourceFormat GetFormat() const { return format_; }
+ void* GetPixels() { return pixels_.get(); }
+
+ private:
+ scoped_ptr<uint8_t[]> pixels_;
+ UIResourceFormat format_;
+ gfx::Size size_;
+};
+
+} // namespace cc
+
+#endif // CC_RESOURCES_UI_RESOURCE_BITMAP_H_

Powered by Google App Engine
This is Rietveld 408576698