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

Unified Diff: cc/resources/shared_bitmap.cc

Issue 148243013: Add shared bitmap managers for browser and renderer processes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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/shared_bitmap.cc
diff --git a/cc/resources/shared_bitmap.cc b/cc/resources/shared_bitmap.cc
index 3a6fc3589e3a8471b9a4d10e75278c76bfbe0a41..fed27626de0dee5e6465aa79defc79fd97be3841 100644
--- a/cc/resources/shared_bitmap.cc
+++ b/cc/resources/shared_bitmap.cc
@@ -4,6 +4,8 @@
#include "cc/resources/shared_bitmap.h"
+#include "base/rand_util.h"
+
namespace cc {
SharedBitmap::SharedBitmap(
@@ -14,4 +16,16 @@ SharedBitmap::SharedBitmap(
SharedBitmap::~SharedBitmap() { free_callback_.Run(this); }
+// static
+size_t SharedBitmap::GetSizeInBytes(const gfx::Size& size) {
+ return size.GetArea() * 4;
+}
+
+// static
+SharedBitmapId SharedBitmap::GenerateId() {
+ SharedBitmapId id;
+ base::RandBytes(id.name, sizeof id.name);
danakj 2014/01/30 22:59:01 nit: sizeof(id.name)
+ return id;
+}
+
} // namespace cc

Powered by Google App Engine
This is Rietveld 408576698