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

Unified Diff: cc/resources/shared_bitmap.h

Issue 761903003: Update from https://crrev.com/306655 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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 | « cc/resources/resource_provider.cc ('k') | 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 ca1271061f03ef578daa626c8ec08bdd87e10427..bbf0823286debb7259876ccc2590a1cd73aff7aa 100644
--- a/cc/resources/shared_bitmap.h
+++ b/cc/resources/shared_bitmap.h
@@ -6,8 +6,7 @@
#define CC_RESOURCES_SHARED_BITMAP_H_
#include "base/basictypes.h"
-#include "base/callback.h"
-#include "base/memory/shared_memory.h"
+#include "base/memory/scoped_ptr.h"
#include "cc/base/cc_export.h"
#include "gpu/command_buffer/common/mailbox.h"
#include "ui/gfx/geometry/size.h"
@@ -19,29 +18,15 @@ typedef gpu::Mailbox SharedBitmapId;
class CC_EXPORT SharedBitmap {
public:
- SharedBitmap(base::SharedMemory* memory,
- const SharedBitmapId& id,
- const base::Callback<void(SharedBitmap* bitmap)>& free_callback);
+ SharedBitmap(uint8* pixels, const SharedBitmapId& id);
- SharedBitmap(uint8* pixels,
- const SharedBitmapId& id,
- const base::Callback<void(SharedBitmap* bitmap)>& free_callback);
-
- ~SharedBitmap();
-
- bool operator<(const SharedBitmap& right) const {
- if (memory_ < right.memory_)
- return true;
- if (memory_ > right.memory_)
- return false;
- return id_ < right.id_;
- }
+ virtual ~SharedBitmap();
uint8* pixels() { return pixels_; }
- base::SharedMemory* memory() { return memory_; }
+ virtual base::SharedMemory* memory() = 0;
- SharedBitmapId id() { return id_; }
+ const SharedBitmapId& id() { return id_; }
// Returns true if the size is valid and false otherwise.
static bool SizeInBytes(const gfx::Size& size, size_t* size_in_bytes);
@@ -57,10 +42,8 @@ class CC_EXPORT SharedBitmap {
static SharedBitmapId GenerateId();
private:
- base::SharedMemory* memory_;
uint8* pixels_;
SharedBitmapId id_;
- base::Callback<void(SharedBitmap* bitmap)> free_callback_;
DISALLOW_COPY_AND_ASSIGN(SharedBitmap);
};
« no previous file with comments | « cc/resources/resource_provider.cc ('k') | cc/resources/shared_bitmap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698