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

Side by Side Diff: ui/gl/gl_image_io_surface.mm

Issue 2819803002: Reorganize GUIDs for GPU memory buffers (Closed)
Patch Set: Address on reviews Created 3 years, 8 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 | « ui/gfx/gpu_memory_buffer_tracing.cc ('k') | ui/gl/gl_image_shared_memory.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 "ui/gl/gl_image_io_surface.h" 5 #include "ui/gl/gl_image_io_surface.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "base/callback_helpers.h" 9 #include "base/callback_helpers.h"
10 #include "base/mac/bind_objc_block.h" 10 #include "base/mac/bind_objc_block.h"
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 static_cast<uint64_t>(size_bytes)); 368 static_cast<uint64_t>(size_bytes));
369 369
370 // The process tracing id is to identify the GpuMemoryBuffer client that 370 // The process tracing id is to identify the GpuMemoryBuffer client that
371 // created the allocation. For CVPixelBufferRefs, there is no corresponding 371 // created the allocation. For CVPixelBufferRefs, there is no corresponding
372 // GpuMemoryBuffer, so use an invalid process id. 372 // GpuMemoryBuffer, so use an invalid process id.
373 if (cv_pixel_buffer_) { 373 if (cv_pixel_buffer_) {
374 process_tracing_id = 374 process_tracing_id =
375 base::trace_event::MemoryDumpManager::kInvalidTracingProcessId; 375 base::trace_event::MemoryDumpManager::kInvalidTracingProcessId;
376 } 376 }
377 377
378 auto guid = 378 auto guid = GetGenericSharedGpuMemoryGUIDForTracing(process_tracing_id,
379 GetGenericSharedMemoryGUIDForTracing(process_tracing_id, io_surface_id_); 379 io_surface_id_);
380 pmd->CreateSharedGlobalAllocatorDump(guid); 380 pmd->CreateSharedGlobalAllocatorDump(guid);
381 pmd->AddOwnershipEdge(dump->guid(), guid); 381 pmd->AddOwnershipEdge(dump->guid(), guid);
382 } 382 }
383 383
384 bool GLImageIOSurface::EmulatingRGB() const { 384 bool GLImageIOSurface::EmulatingRGB() const {
385 return client_internalformat_ == GL_RGB; 385 return client_internalformat_ == GL_RGB;
386 } 386 }
387 387
388 bool GLImageIOSurface::CanCheckIOSurfaceIsInUse() const { 388 bool GLImageIOSurface::CanCheckIOSurfaceIsInUse() const {
389 return !cv_pixel_buffer_; 389 return !cv_pixel_buffer_;
(...skipping 19 matching lines...) Expand all
409 } 409 }
410 410
411 // static 411 // static
412 GLImageIOSurface* GLImageIOSurface::FromGLImage(GLImage* image) { 412 GLImageIOSurface* GLImageIOSurface::FromGLImage(GLImage* image) {
413 if (!image || image->GetType() != Type::IOSURFACE) 413 if (!image || image->GetType() != Type::IOSURFACE)
414 return nullptr; 414 return nullptr;
415 return static_cast<GLImageIOSurface*>(image); 415 return static_cast<GLImageIOSurface*>(image);
416 } 416 }
417 417
418 } // namespace gl 418 } // namespace gl
OLDNEW
« no previous file with comments | « ui/gfx/gpu_memory_buffer_tracing.cc ('k') | ui/gl/gl_image_shared_memory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698