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

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

Issue 1539203002: Switch to standard integer types in cc/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more includes 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 unified diff | Download patch
« no previous file with comments | « cc/resources/shared_bitmap.h ('k') | cc/resources/shared_bitmap_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/resources/shared_bitmap.h" 5 #include "cc/resources/shared_bitmap.h"
6 6
7 #include <stddef.h>
8 #include <stdint.h>
9
7 #include "base/logging.h" 10 #include "base/logging.h"
8 #include "base/numerics/safe_math.h" 11 #include "base/numerics/safe_math.h"
9 #include "base/rand_util.h" 12 #include "base/rand_util.h"
10 #include "base/strings/string_number_conversions.h" 13 #include "base/strings/string_number_conversions.h"
11 #include "base/strings/stringprintf.h" 14 #include "base/strings/stringprintf.h"
12 15
13 namespace cc { 16 namespace cc {
14 17
15 SharedBitmap::SharedBitmap(uint8* pixels, const SharedBitmapId& id) 18 SharedBitmap::SharedBitmap(uint8_t* pixels, const SharedBitmapId& id)
16 : pixels_(pixels), id_(id) { 19 : pixels_(pixels), id_(id) {}
17 }
18 20
19 SharedBitmap::~SharedBitmap() { 21 SharedBitmap::~SharedBitmap() {
20 } 22 }
21 23
22 // static 24 // static
23 bool SharedBitmap::SizeInBytes(const gfx::Size& size, size_t* size_in_bytes) { 25 bool SharedBitmap::SizeInBytes(const gfx::Size& size, size_t* size_in_bytes) {
24 if (size.IsEmpty()) 26 if (size.IsEmpty())
25 return false; 27 return false;
26 base::CheckedNumeric<size_t> s = 4; 28 base::CheckedNumeric<size_t> s = 4;
27 s *= size.width(); 29 s *= size.width();
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 } 71 }
70 72
71 base::trace_event::MemoryAllocatorDumpGuid GetSharedBitmapGUIDForTracing( 73 base::trace_event::MemoryAllocatorDumpGuid GetSharedBitmapGUIDForTracing(
72 const SharedBitmapId& bitmap_id) { 74 const SharedBitmapId& bitmap_id) {
73 auto bitmap_id_hex = base::HexEncode(bitmap_id.name, sizeof(bitmap_id.name)); 75 auto bitmap_id_hex = base::HexEncode(bitmap_id.name, sizeof(bitmap_id.name));
74 return base::trace_event::MemoryAllocatorDumpGuid( 76 return base::trace_event::MemoryAllocatorDumpGuid(
75 base::StringPrintf("sharedbitmap-x-process/%s", bitmap_id_hex.c_str())); 77 base::StringPrintf("sharedbitmap-x-process/%s", bitmap_id_hex.c_str()));
76 } 78 }
77 79
78 } // namespace cc 80 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/shared_bitmap.h ('k') | cc/resources/shared_bitmap_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698