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

Unified Diff: cc/resources/shared_bitmap.h

Issue 1531403002: Revert "Delete CC." (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 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/scoped_resource_unittest.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
new file mode 100644
index 0000000000000000000000000000000000000000..793ef7a4261b0aa5deb1a5de38d4e19771f2baaa
--- /dev/null
+++ b/cc/resources/shared_bitmap.h
@@ -0,0 +1,47 @@
+// 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_SHARED_BITMAP_H_
+#define CC_RESOURCES_SHARED_BITMAP_H_
+
+#include "base/basictypes.h"
+#include "gpu/command_buffer/common/mailbox.h"
+#include "ui/gfx/geometry/size.h"
+
+namespace cc {
+typedef gpu::Mailbox SharedBitmapId;
+
+class SharedBitmap {
+ public:
+ SharedBitmap(uint8* pixels, const SharedBitmapId& id);
+
+ virtual ~SharedBitmap();
+
+ uint8* pixels() { return pixels_; }
+
+ 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);
+ // Dies with a CRASH() if the size can not be represented as a positive number
+ // of bytes.
+ static size_t CheckedSizeInBytes(const gfx::Size& size);
+ // Returns the size in bytes but may overflow or return 0. Only do this for
+ // sizes that have already been checked.
+ static size_t UncheckedSizeInBytes(const gfx::Size& size);
+ // Returns true if the size is valid and false otherwise.
+ static bool VerifySizeInBytes(const gfx::Size& size);
+
+ static SharedBitmapId GenerateId();
+
+ private:
+ uint8* pixels_;
+ SharedBitmapId id_;
+
+ DISALLOW_COPY_AND_ASSIGN(SharedBitmap);
+};
+
+} // namespace cc
+
+#endif // CC_RESOURCES_SHARED_BITMAP_H_
« no previous file with comments | « cc/resources/scoped_resource_unittest.cc ('k') | cc/resources/shared_bitmap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698