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

Side by Side Diff: content/common/gpu/client/command_buffer_proxy_impl.cc

Issue 968283002: content: Remove use of GLImage from GpuMemoryBufferImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add size check to gmb code Created 5 years, 9 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/common/gpu/client/command_buffer_proxy_impl.h" 5 #include "content/common/gpu/client/command_buffer_proxy_impl.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/shared_memory.h" 9 #include "base/memory/shared_memory.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 DCHECK(gpu_memory_buffer); 364 DCHECK(gpu_memory_buffer);
365 365
366 // This handle is owned by the GPU process and must be passed to it or it 366 // This handle is owned by the GPU process and must be passed to it or it
367 // will leak. In otherwords, do not early out on error between here and the 367 // will leak. In otherwords, do not early out on error between here and the
368 // sending of the CreateImage IPC below. 368 // sending of the CreateImage IPC below.
369 bool requires_sync_point = false; 369 bool requires_sync_point = false;
370 gfx::GpuMemoryBufferHandle handle = 370 gfx::GpuMemoryBufferHandle handle =
371 channel_->ShareGpuMemoryBufferToGpuProcess(gpu_memory_buffer->GetHandle(), 371 channel_->ShareGpuMemoryBufferToGpuProcess(gpu_memory_buffer->GetHandle(),
372 &requires_sync_point); 372 &requires_sync_point);
373 373
374 DCHECK(gpu::ImageFactory::IsImageSizeValidForGpuMemoryBufferFormat(
375 gfx::Size(width, height), gpu_memory_buffer->GetFormat()));
374 DCHECK(gpu::ImageFactory::IsImageFormatCompatibleWithGpuMemoryBufferFormat( 376 DCHECK(gpu::ImageFactory::IsImageFormatCompatibleWithGpuMemoryBufferFormat(
375 internalformat, gpu_memory_buffer->GetFormat())); 377 internalformat, gpu_memory_buffer->GetFormat()));
376 if (!Send(new GpuCommandBufferMsg_CreateImage(route_id_, 378 if (!Send(new GpuCommandBufferMsg_CreateImage(route_id_,
377 new_id, 379 new_id,
378 handle, 380 handle,
379 gfx::Size(width, height), 381 gfx::Size(width, height),
380 gpu_memory_buffer->GetFormat(), 382 gpu_memory_buffer->GetFormat(),
381 internalformat))) { 383 internalformat))) {
382 return -1; 384 return -1;
383 } 385 }
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
602 } 604 }
603 } 605 }
604 606
605 void CommandBufferProxyImpl::OnUpdateVSyncParameters(base::TimeTicks timebase, 607 void CommandBufferProxyImpl::OnUpdateVSyncParameters(base::TimeTicks timebase,
606 base::TimeDelta interval) { 608 base::TimeDelta interval) {
607 if (!update_vsync_parameters_completion_callback_.is_null()) 609 if (!update_vsync_parameters_completion_callback_.is_null())
608 update_vsync_parameters_completion_callback_.Run(timebase, interval); 610 update_vsync_parameters_completion_callback_.Run(timebase, interval);
609 } 611 }
610 612
611 } // namespace content 613 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/gpu/browser_gpu_memory_buffer_manager.cc ('k') | content/common/gpu/client/gpu_memory_buffer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698