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

Unified Diff: cc/resources/shared_bitmap.h

Issue 307973004: Allow creating SharedBitmaps backed by new[] (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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
« no previous file with comments | « no previous file | cc/resources/shared_bitmap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/shared_bitmap.h
diff --git a/cc/resources/shared_bitmap.h b/cc/resources/shared_bitmap.h
index 762547d5cbe2b66dc4dd5bf5f398840465fccaae..a90e47a084cc0e2e7ffde0e1c0c606f78bfcf152 100644
--- a/cc/resources/shared_bitmap.h
+++ b/cc/resources/shared_bitmap.h
@@ -23,6 +23,10 @@ class CC_EXPORT SharedBitmap {
const SharedBitmapId& id,
const base::Callback<void(SharedBitmap* bitmap)>& free_callback);
+ SharedBitmap(uint8* pixels,
+ const SharedBitmapId& id,
+ const base::Callback<void(SharedBitmap* bitmap)>& free_callback);
+
~SharedBitmap();
bool operator<(const SharedBitmap& right) const {
@@ -33,7 +37,7 @@ class CC_EXPORT SharedBitmap {
return id_ < right.id_;
}
- uint8* pixels() { return static_cast<uint8*>(memory_->memory()); }
+ uint8* pixels() { return pixels_; }
base::SharedMemory* memory() { return memory_; }
@@ -54,6 +58,7 @@ class CC_EXPORT SharedBitmap {
private:
base::SharedMemory* memory_;
+ uint8* pixels_;
SharedBitmapId id_;
base::Callback<void(SharedBitmap* bitmap)> free_callback_;
« no previous file with comments | « no previous file | cc/resources/shared_bitmap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698