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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/compositor/gpu_process_transport_factory.cc
diff --git a/content/browser/compositor/gpu_process_transport_factory.cc b/content/browser/compositor/gpu_process_transport_factory.cc
index 95c3f1d13ec94aaffd707fea6641362b7676c7ae..fa3892462616c1a8d591eb91be786c58181dc8c0 100644
--- a/content/browser/compositor/gpu_process_transport_factory.cc
+++ b/content/browser/compositor/gpu_process_transport_factory.cc
@@ -402,7 +402,18 @@ void GpuProcessTransportFactory::RemoveCompositor(ui::Compositor* compositor) {
bool GpuProcessTransportFactory::DoesCreateTestContexts() { return false; }
uint32 GpuProcessTransportFactory::GetImageTextureTarget() {
- return BrowserGpuChannelHostFactory::GetImageTextureTarget();
+ // TODO(reveman): We currently assume that the compositor will use BGRA_8888
+ // if it's able to, and RGBA_8888 otherwise. Since we don't know what it will
+ // use we hardcode BGRA_8888 here for now. We should instead
+ // move decisions about GpuMemoryBuffer format to the browser embedder so we
+ // know it here, and pass that decision to the compositor for each usage.
+ gfx::GpuMemoryBuffer::Format format = gfx::GpuMemoryBuffer::BGRA_8888;
+
+ // TODO(danakj): When one-copy uploads support partial update, change this
+ // usage to PERSISTENT_MAP for one-copy.
+ gfx::GpuMemoryBuffer::Usage usage = gfx::GpuMemoryBuffer::MAP;
+
+ return BrowserGpuChannelHostFactory::GetImageTextureTarget(format, usage);
}
cc::SharedBitmapManager* GpuProcessTransportFactory::GetSharedBitmapManager() {

Powered by Google App Engine
This is Rietveld 408576698