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

Unified Diff: content/browser/renderer_host/compositor_impl_android.cc

Issue 2895273002: Unified the use of BufferToTextureTargetMap for all the Processes (Closed)
Patch Set: Adding BufferToTextureTargetMap for browser process Created 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/compositor_impl_android.cc
diff --git a/content/browser/renderer_host/compositor_impl_android.cc b/content/browser/renderer_host/compositor_impl_android.cc
index fff5edb377455b6abe81f8e9a36ca5d764c3e107..c30af2a8cbb8666067fa2af53e5982c6aa5e5ae3 100644
--- a/content/browser/renderer_host/compositor_impl_android.cc
+++ b/content/browser/renderer_host/compositor_impl_android.cc
@@ -31,6 +31,7 @@
#include "cc/base/switches.h"
#include "cc/input/input_handler.h"
#include "cc/layers/layer.h"
+#include "cc/output/buffer_to_texture_target_map.h"
#include "cc/output/compositor_frame.h"
#include "cc/output/context_provider.h"
#include "cc/output/output_surface.h"
@@ -528,7 +529,19 @@ void CompositorImpl::CreateLayerTreeHost() {
command_line->HasSwitch(cc::switches::kUIShowFPSCounter);
settings.single_thread_proxy_scheduler = true;
- animation_host_ = cc::AnimationHost::CreateMainInstance();
+ cc::BufferToTextureTargetMap image_targets;
+ for (int usage_idx = 0; usage_idx <= static_cast<int>(gfx::BufferUsage::LAST);
+ ++usage_idx) {
+ gfx::BufferUsage usage = static_cast<gfx::BufferUsage>(usage_idx);
+ for (int format_idx = 0;
+ format_idx <= static_cast<int>(gfx::BufferFormat::LAST);
+ ++format_idx) {
+ gfx::BufferFormat format = static_cast<gfx::BufferFormat>(format_idx);
+ uint32_t target = gpu::GetImageTextureTarget(format, usage);
+ image_targets[std::make_pair(usage, format)] = target;
+ }
+ }
+ settings.buffer_to_texture_target_map = image_targets;
reveman 2017/06/05 18:32:37 nit: avoid making a copy of the map by setting it
cc::LayerTreeHost::InitParams params;
params.client = this;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698