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

Side by Side Diff: content/browser/compositor/gpu_process_transport_factory.cc

Issue 1139903005: Add PERSISTENT_MAP usage for GpuMemoryBuffers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: persistentmap: typo Created 5 years, 7 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/browser/compositor/gpu_process_transport_factory.h" 5 #include "content/browser/compositor/gpu_process_transport_factory.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 395
396 helper.reset(); 396 helper.reset();
397 DCHECK(!gl_helper_) << "Destroying the GLHelper should not cause a new " 397 DCHECK(!gl_helper_) << "Destroying the GLHelper should not cause a new "
398 "GLHelper to be created."; 398 "GLHelper to be created.";
399 } 399 }
400 } 400 }
401 401
402 bool GpuProcessTransportFactory::DoesCreateTestContexts() { return false; } 402 bool GpuProcessTransportFactory::DoesCreateTestContexts() { return false; }
403 403
404 uint32 GpuProcessTransportFactory::GetImageTextureTarget() { 404 uint32 GpuProcessTransportFactory::GetImageTextureTarget() {
405 return BrowserGpuChannelHostFactory::GetImageTextureTarget(); 405 // TODO(reveman): We currently assume that the compositor will use BGRA_8888
406 // if it's able to, and RGBA_8888 otherwise. Since we don't know what it will
407 // use we hardcode BGRA_8888 here for now. We should instead
408 // move decisions about GpuMemoryBuffer format to the browser embedder so we
409 // know it here, and pass that decision to the compositor for each usage.
410 gfx::GpuMemoryBuffer::Format format = gfx::GpuMemoryBuffer::BGRA_8888;
411
412 // TODO(danakj): When one-copy uploads support partial update, change this
413 // usage to PERSISTENT_MAP for one-copy.
414 gfx::GpuMemoryBuffer::Usage usage = gfx::GpuMemoryBuffer::MAP;
415
416 return BrowserGpuChannelHostFactory::GetImageTextureTarget(format, usage);
406 } 417 }
407 418
408 cc::SharedBitmapManager* GpuProcessTransportFactory::GetSharedBitmapManager() { 419 cc::SharedBitmapManager* GpuProcessTransportFactory::GetSharedBitmapManager() {
409 return HostSharedBitmapManager::current(); 420 return HostSharedBitmapManager::current();
410 } 421 }
411 422
412 gpu::GpuMemoryBufferManager* 423 gpu::GpuMemoryBufferManager*
413 GpuProcessTransportFactory::GetGpuMemoryBufferManager() { 424 GpuProcessTransportFactory::GetGpuMemoryBufferManager() {
414 return BrowserGpuMemoryBufferManager::current(); 425 return BrowserGpuMemoryBufferManager::current();
415 } 426 }
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
603 FOR_EACH_OBSERVER(ImageTransportFactoryObserver, 614 FOR_EACH_OBSERVER(ImageTransportFactoryObserver,
604 observer_list_, 615 observer_list_,
605 OnLostResources()); 616 OnLostResources());
606 617
607 // Kill things that use the shared context before killing the shared context. 618 // Kill things that use the shared context before killing the shared context.
608 lost_gl_helper.reset(); 619 lost_gl_helper.reset();
609 lost_shared_main_thread_contexts = NULL; 620 lost_shared_main_thread_contexts = NULL;
610 } 621 }
611 622
612 } // namespace content 623 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698