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

Side by Side Diff: cc/resources/shared_bitmap.h

Issue 1535833002: Delete CC. (Closed) Base URL: git@github.com:domokit/mojo.git@moz-5
Patch Set: rebase Created 4 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CC_RESOURCES_SHARED_BITMAP_H_
6 #define CC_RESOURCES_SHARED_BITMAP_H_
7
8 #include "base/basictypes.h"
9 #include "gpu/command_buffer/common/mailbox.h"
10 #include "ui/gfx/geometry/size.h"
11
12 namespace cc {
13 typedef gpu::Mailbox SharedBitmapId;
14
15 class SharedBitmap {
16 public:
17 SharedBitmap(uint8* pixels, const SharedBitmapId& id);
18
19 virtual ~SharedBitmap();
20
21 uint8* pixels() { return pixels_; }
22
23 const SharedBitmapId& id() { return id_; }
24
25 // Returns true if the size is valid and false otherwise.
26 static bool SizeInBytes(const gfx::Size& size, size_t* size_in_bytes);
27 // Dies with a CRASH() if the size can not be represented as a positive number
28 // of bytes.
29 static size_t CheckedSizeInBytes(const gfx::Size& size);
30 // Returns the size in bytes but may overflow or return 0. Only do this for
31 // sizes that have already been checked.
32 static size_t UncheckedSizeInBytes(const gfx::Size& size);
33 // Returns true if the size is valid and false otherwise.
34 static bool VerifySizeInBytes(const gfx::Size& size);
35
36 static SharedBitmapId GenerateId();
37
38 private:
39 uint8* pixels_;
40 SharedBitmapId id_;
41
42 DISALLOW_COPY_AND_ASSIGN(SharedBitmap);
43 };
44
45 } // namespace cc
46
47 #endif // CC_RESOURCES_SHARED_BITMAP_H_
OLDNEW
« 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