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

Unified Diff: content/renderer/gpu/render_widget_compositor.cc

Issue 1713503002: Reland Allow one-copy and zero-copy task tile worker pools to use compressed textures. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 10 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 | « content/browser/renderer_host/render_process_host_impl.cc ('k') | ui/compositor/compositor.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/gpu/render_widget_compositor.cc
diff --git a/content/renderer/gpu/render_widget_compositor.cc b/content/renderer/gpu/render_widget_compositor.cc
index 004adddf8a6f84c6890388d205c1b62141bd764d..2d97eca821ed33a5ee713885e7e1b3ca53ebc609 100644
--- a/content/renderer/gpu/render_widget_compositor.cc
+++ b/content/renderer/gpu/render_widget_compositor.cc
@@ -406,14 +406,16 @@ void RenderWidgetCompositor::Initialize(float device_scale_factor) {
// low end, so always use default policy.
bool use_low_memory_policy =
base::SysInfo::IsLowEndDevice() && !using_synchronous_compositor;
- // RGBA_4444 textures are only enabled by default for low end devices
- // and are disabled for Android WebView as it doesn't support the format.
- settings.renderer_settings.use_rgba_4444_textures = use_low_memory_policy;
if (use_low_memory_policy) {
// On low-end we want to be very carefull about killing other
// apps. So initially we use 50% more memory to avoid flickering
// or raster-on-demand.
settings.max_memory_for_prepaint_percentage = 67;
+
+ // RGBA_4444 textures are only enabled by default for low end devices
+ // and are disabled for Android WebView as it doesn't support the format.
+ if (!cmd->HasSwitch(switches::kDisableRGBA4444Textures))
+ settings.renderer_settings.preferred_tile_format = cc::RGBA_4444;
} else {
// On other devices we have increased memory excessively to avoid
// raster-on-demand already, so now we reserve 50% _only_ to avoid
@@ -449,10 +451,14 @@ void RenderWidgetCompositor::Initialize(float device_scale_factor) {
if (cmd->HasSwitch(cc::switches::kEnableBeginFrameScheduling))
settings.use_external_begin_frame_source = true;
- settings.renderer_settings.use_rgba_4444_textures |=
- cmd->HasSwitch(switches::kEnableRGBA4444Textures);
- settings.renderer_settings.use_rgba_4444_textures &=
- !cmd->HasSwitch(switches::kDisableRGBA4444Textures);
+ if (cmd->HasSwitch(switches::kEnableRGBA4444Textures) &&
+ !cmd->HasSwitch(switches::kDisableRGBA4444Textures)) {
+ settings.renderer_settings.preferred_tile_format = cc::RGBA_4444;
+ }
+
+ if (cmd->HasSwitch(cc::switches::kEnableTileCompression)) {
+ settings.renderer_settings.preferred_tile_format = cc::ETC1;
+ }
if (delegate_->ForOOPIF()) {
// TODO(simonhong): Apply BeginFrame scheduling for OOPIF.
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.cc ('k') | ui/compositor/compositor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698