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

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

Issue 1256613002: Add tracing for GL texture objects (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@browser_process_id
Patch Set: Key texture manager memory dump provider registration off of memory_tracker_ Created 5 years, 4 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/shared_bitmap.h ('k') | components/view_manager/gles2/command_buffer_driver.cc » ('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 "base/logging.h" 7 #include "base/logging.h"
8 #include "base/numerics/safe_math.h" 8 #include "base/numerics/safe_math.h"
9 #include "base/rand_util.h" 9 #include "base/rand_util.h"
10 #include "base/strings/string_number_conversions.h"
11 #include "base/strings/stringprintf.h"
10 12
11 namespace cc { 13 namespace cc {
12 14
13 SharedBitmap::SharedBitmap(uint8* pixels, const SharedBitmapId& id) 15 SharedBitmap::SharedBitmap(uint8* pixels, const SharedBitmapId& id)
14 : pixels_(pixels), id_(id) { 16 : pixels_(pixels), id_(id) {
15 } 17 }
16 18
17 SharedBitmap::~SharedBitmap() { 19 SharedBitmap::~SharedBitmap() {
18 } 20 }
19 21
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 } 61 }
60 62
61 // static 63 // static
62 SharedBitmapId SharedBitmap::GenerateId() { 64 SharedBitmapId SharedBitmap::GenerateId() {
63 SharedBitmapId id; 65 SharedBitmapId id;
64 // Needs cryptographically-secure random numbers. 66 // Needs cryptographically-secure random numbers.
65 base::RandBytes(id.name, sizeof(id.name)); 67 base::RandBytes(id.name, sizeof(id.name));
66 return id; 68 return id;
67 } 69 }
68 70
71 base::trace_event::MemoryAllocatorDumpGuid GetSharedBitmapGUIDForTracing(
72 const SharedBitmapId& bitmap_id) {
73 auto bitmap_id_hex = base::HexEncode(bitmap_id.name, sizeof(bitmap_id.name));
74 return base::trace_event::MemoryAllocatorDumpGuid(
75 base::StringPrintf("sharedbitmap-x-process/%s", bitmap_id_hex.c_str()));
76 }
77
69 } // namespace cc 78 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/shared_bitmap.h ('k') | components/view_manager/gles2/command_buffer_driver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698