| OLD | NEW |
| 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 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 auto guid = | 357 auto guid = |
| 358 GetGenericSharedMemoryGUIDForTracing(process_tracing_id, io_surface_id_); | 358 GetGenericSharedMemoryGUIDForTracing(process_tracing_id, io_surface_id_); |
| 359 pmd->CreateSharedGlobalAllocatorDump(guid); | 359 pmd->CreateSharedGlobalAllocatorDump(guid); |
| 360 pmd->AddOwnershipEdge(dump->guid(), guid); | 360 pmd->AddOwnershipEdge(dump->guid(), guid); |
| 361 } | 361 } |
| 362 | 362 |
| 363 bool GLImageIOSurface::EmulatingRGB() const { | 363 bool GLImageIOSurface::EmulatingRGB() const { |
| 364 return client_internalformat_ == GL_RGB; | 364 return client_internalformat_ == GL_RGB; |
| 365 } | 365 } |
| 366 | 366 |
| 367 bool GLImageIOSurface::CanCheckIOSurfaceIsInUse() const { |
| 368 return !cv_pixel_buffer_; |
| 369 } |
| 370 |
| 367 base::ScopedCFTypeRef<IOSurfaceRef> GLImageIOSurface::io_surface() { | 371 base::ScopedCFTypeRef<IOSurfaceRef> GLImageIOSurface::io_surface() { |
| 368 return io_surface_; | 372 return io_surface_; |
| 369 } | 373 } |
| 370 | 374 |
| 371 base::ScopedCFTypeRef<CVPixelBufferRef> GLImageIOSurface::cv_pixel_buffer() { | 375 base::ScopedCFTypeRef<CVPixelBufferRef> GLImageIOSurface::cv_pixel_buffer() { |
| 372 return cv_pixel_buffer_; | 376 return cv_pixel_buffer_; |
| 373 } | 377 } |
| 374 | 378 |
| 375 // static | 379 // static |
| 376 unsigned GLImageIOSurface::GetInternalFormatForTesting( | 380 unsigned GLImageIOSurface::GetInternalFormatForTesting( |
| 377 gfx::BufferFormat format) { | 381 gfx::BufferFormat format) { |
| 378 DCHECK(ValidFormat(format)); | 382 DCHECK(ValidFormat(format)); |
| 379 return TextureFormat(format); | 383 return TextureFormat(format); |
| 380 } | 384 } |
| 381 } // namespace gl | 385 } // namespace gl |
| OLD | NEW |