diff options
author | epenner@chromium.org <epenner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-24 23:11:45 +0000 |
---|---|---|
committer | epenner@chromium.org <epenner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-24 23:11:45 +0000 |
commit | 9fbca05dba3674cd4b9729a819745dfe423256af (patch) | |
tree | 2545b8aceecbe210a5e18f784fdb236bb818e75d /content/gpu | |
parent | f7c2871cb76742220ec4708e8ee0a68491a7c4f4 (diff) | |
download | chromium_src-9fbca05dba3674cd4b9729a819745dfe423256af.zip chromium_src-9fbca05dba3674cd4b9729a819745dfe423256af.tar.gz chromium_src-9fbca05dba3674cd4b9729a819745dfe423256af.tar.bz2 |
gpu: Async texture uploads for imagination drivers
This patch implements a limited async upload fast-path
for imagination drivers. The fast path is limited to
non-power-of-two but still multiple-of-eight textures.
This also cleans up the other Qualcomm work-around,
now that we have confirmed it's a Qualcomm bug.
BUG=168099
Review URL: https://chromiumcodereview.appspot.com/12051068
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@178687 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/gpu')
-rw-r--r-- | content/gpu/gpu_info_collector_android.cc | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/content/gpu/gpu_info_collector_android.cc b/content/gpu/gpu_info_collector_android.cc index 924b119..557b537 100644 --- a/content/gpu/gpu_info_collector_android.cc +++ b/content/gpu/gpu_info_collector_android.cc @@ -11,6 +11,7 @@ #include "base/string_split.h" #include "base/string_util.h" #include "content/public/common/content_switches.h" +#include "ui/gfx/android/device_display_info.h" namespace { @@ -72,6 +73,42 @@ bool CollectBasicGraphicsInfo(content::GPUInfo* gpu_info) { CommandLine::ForCurrentProcess()->AppendSwitch( switches::kEnableVirtualGLContexts); } + + gfx::DeviceDisplayInfo info; + int default_tile_size = 256; + + // For very high resolution displays (eg. Nexus 10), set the default + // tile size to be 512. This should be removed in favour of a generic + // hueristic that works across all platforms and devices, once that + // exists: http://crbug.com/159524. This switches to 512 for screens + // containing 40 or more 256x256 tiles, such that 1080p devices do + // not use 512x512 tiles (eg. 1920x1280 requires 37.5 tiles) + int numTiles = (info.GetDisplayWidth() * + info.GetDisplayHeight()) / (256 * 256); + if (numTiles >= 40) + default_tile_size = 512; + + // IMG: Fast async texture uploads only work with non-power-of-two, + // but still multiple-of-eight sizes. + // http://crbug.com/168099 + if (is_img) + default_tile_size -= 8; + + // Set the command line if it isn't already set and we changed + // the default tile size. + if (default_tile_size != 256 && + !CommandLine::ForCurrentProcess()->HasSwitch( + switches::kDefaultTileWidth) && + !CommandLine::ForCurrentProcess()->HasSwitch( + switches::kDefaultTileHeight)) { + std::stringstream size; + size << default_tile_size; + CommandLine::ForCurrentProcess()->AppendSwitchASCII( + switches::kDefaultTileWidth, size.str()); + CommandLine::ForCurrentProcess()->AppendSwitchASCII( + switches::kDefaultTileHeight, size.str()); + } + return true; } |