| Index: cc/resources/resource_provider.cc
|
| diff --git a/cc/resources/resource_provider.cc b/cc/resources/resource_provider.cc
|
| index 49dae1d6ae988284713422c430f0f1e8a2f814e8..c48f96db5b9a54d8a94a6b2b13cfbd53cfdf3cf1 100644
|
| --- a/cc/resources/resource_provider.cc
|
| +++ b/cc/resources/resource_provider.cc
|
| @@ -12,6 +12,7 @@
|
| #include <unordered_map>
|
|
|
| #include "base/atomic_sequence_num.h"
|
| +#include "base/command_line.h"
|
| #include "base/macros.h"
|
| #include "base/metrics/histogram.h"
|
| #include "base/numerics/safe_math.h"
|
| @@ -22,6 +23,7 @@
|
| #include "base/threading/thread_task_runner_handle.h"
|
| #include "base/trace_event/memory_dump_manager.h"
|
| #include "base/trace_event/trace_event.h"
|
| +#include "cc/base/switches.h"
|
| #include "cc/resources/platform_color.h"
|
| #include "cc/resources/resource_util.h"
|
| #include "cc/resources/returned_resource.h"
|
| @@ -92,6 +94,7 @@ GLenum TextureToStorageFormat(ResourceFormat format) {
|
| case RGB_565:
|
| case ETC1:
|
| case RED_8:
|
| + case RG_88:
|
| case LUMINANCE_F16:
|
| NOTREACHED();
|
| break;
|
| @@ -112,6 +115,7 @@ bool IsFormatSupportedForStorage(ResourceFormat format, bool use_bgra) {
|
| case RGB_565:
|
| case ETC1:
|
| case RED_8:
|
| + case RG_88:
|
| case LUMINANCE_F16:
|
| return false;
|
| }
|
| @@ -456,6 +460,13 @@ ResourceProvider::ResourceProvider(
|
| yuv_resource_format_ = caps.texture_rg ? RED_8 : LUMINANCE_8;
|
| yuv_highbit_resource_format_ =
|
| caps.texture_half_float_linear ? LUMINANCE_F16 : yuv_resource_format_;
|
| + const base::CommandLine* command_line =
|
| + base::CommandLine::ForCurrentProcess();
|
| + if (command_line->HasSwitch(switches::kDisableHalfFloatConversionTexture) ||
|
| + !caps.texture_half_float_linear) {
|
| + yuv_highbit_resource_format_ =
|
| + caps.texture_rg ? RG_88 : yuv_highbit_resource_format_;
|
| + }
|
| }
|
|
|
| use_sync_query_ = caps.sync_query;
|
| @@ -523,6 +534,7 @@ bool ResourceProvider::IsResourceFormatSupported(ResourceFormat format) const {
|
| case ETC1:
|
| return caps.texture_format_etc1;
|
| case RED_8:
|
| + case RG_88:
|
| return caps.texture_rg;
|
| case LUMINANCE_F16:
|
| return caps.texture_half_float_linear;
|
| @@ -664,6 +676,7 @@ ResourceId ResourceProvider::CreateResourceFromTextureMailbox(
|
| DCHECK(mailbox.IsValid());
|
| Resource* resource = nullptr;
|
| if (mailbox.IsTexture()) {
|
| + // TODO(dshwang): the resource can be R_8 or RG_88. crbug.com/624436
|
| resource = InsertResource(
|
| id,
|
| Resource(0, mailbox.size_in_pixels(), Resource::EXTERNAL,
|
|
|