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

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

Issue 1379783002: Allow one-copy task tile worker pool to use compressed textures. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Replace memory_efficient_format* with preferred_tile_format Created 5 years 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/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 0eb8bc053d95fc9920267d4b08030334344dc065..1b3449bde948e0a6cb5e5162550111b80b630f68 100644
--- a/content/renderer/gpu/render_widget_compositor.cc
+++ b/content/renderer/gpu/render_widget_compositor.cc
@@ -33,6 +33,7 @@
#include "cc/output/latency_info_swap_promise.h"
#include "cc/output/swap_promise.h"
#include "cc/proto/compositor_message.pb.h"
+#include "cc/resources/platform_color.h"
reveman 2015/12/02 18:27:18 nit: I don't think you need this with the changes
christiank 2015/12/03 12:57:59 Done.
#include "cc/resources/single_release_callback.h"
#include "cc/scheduler/begin_frame_source.h"
#include "cc/trees/latency_info_swap_promise_monitor.h"
@@ -408,14 +409,15 @@ void RenderWidgetCompositor::Initialize() {
// 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.
+ settings.renderer_settings.preferred_tile_format = cc::RGBA_4444;
reveman 2015/12/02 18:27:18 nit: if (!cmd->HasSwitch(switches::kDisableRGBA444
christiank 2015/12/03 12:58:00 Done.
} else {
// On other devices we have increased memory excessively to avoid
// raster-on-demand already, so now we reserve 50% _only_ to avoid
@@ -451,10 +453,19 @@ void RenderWidgetCompositor::Initialize() {
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)) {
+ settings.renderer_settings.preferred_tile_format = cc::RGBA_4444;
+ }
+ if (cmd->HasSwitch(switches::kDisableRGBA4444Textures)) {
reveman 2015/12/02 18:27:18 nit: please make setting referred_tile_format to R
christiank 2015/12/03 12:58:00 Done.
+ // Assume BGRA is supported here, if the preferred tile format isn't
+ // supported the compositor will choose the best supported format for us.
+ settings.renderer_settings.preferred_tile_format =
+ cc::PlatformColor::BestTextureFormat(true);
+ }
+
+ if (cmd->HasSwitch(cc::switches::kEnableTileCompression)) {
+ settings.renderer_settings.preferred_tile_format = cc::ETC1;
+ }
if (widget_->for_oopif()) {
// TODO(simonhong): Apply BeginFrame scheduling for OOPIF.

Powered by Google App Engine
This is Rietveld 408576698