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

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

Issue 1151943003: Revert of Add PERSISTENT_MAP usage for GpuMemoryBuffers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 // TODO(reveman): We currently assume that the compositor will use BGRA_8888 405 return BrowserGpuChannelHostFactory::GetImageTextureTarget();
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 // crbug.com/490362
411 gfx::GpuMemoryBuffer::Format format = gfx::GpuMemoryBuffer::BGRA_8888;
412
413 // TODO(danakj): When one-copy uploads support partial update, change this
414 // usage to PERSISTENT_MAP for one-copy.
415 gfx::GpuMemoryBuffer::Usage usage = gfx::GpuMemoryBuffer::MAP;
416
417 return BrowserGpuChannelHostFactory::GetImageTextureTarget(format, usage);
418 } 406 }
419 407
420 cc::SharedBitmapManager* GpuProcessTransportFactory::GetSharedBitmapManager() { 408 cc::SharedBitmapManager* GpuProcessTransportFactory::GetSharedBitmapManager() {
421 return HostSharedBitmapManager::current(); 409 return HostSharedBitmapManager::current();
422 } 410 }
423 411
424 gpu::GpuMemoryBufferManager* 412 gpu::GpuMemoryBufferManager*
425 GpuProcessTransportFactory::GetGpuMemoryBufferManager() { 413 GpuProcessTransportFactory::GetGpuMemoryBufferManager() {
426 return BrowserGpuMemoryBufferManager::current(); 414 return BrowserGpuMemoryBufferManager::current();
427 } 415 }
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
615 FOR_EACH_OBSERVER(ImageTransportFactoryObserver, 603 FOR_EACH_OBSERVER(ImageTransportFactoryObserver,
616 observer_list_, 604 observer_list_,
617 OnLostResources()); 605 OnLostResources());
618 606
619 // Kill things that use the shared context before killing the shared context. 607 // Kill things that use the shared context before killing the shared context.
620 lost_gl_helper.reset(); 608 lost_gl_helper.reset();
621 lost_shared_main_thread_contexts = NULL; 609 lost_shared_main_thread_contexts = NULL;
622 } 610 }
623 611
624 } // namespace content 612 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/browser_main_loop.cc ('k') | content/browser/gpu/browser_gpu_channel_host_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698