summaryrefslogtreecommitdiff
path: root/gpu
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2014-04-03 12:29:45 +0100
committerBen Murdoch <benm@google.com>2014-04-03 12:29:45 +0100
commite5d81f57cb97b3b6b7fccc9c5610d21eb81db09d (patch)
treef266aab56db899073b21c1edd1d0e00055b9a2cf /gpu
parent67e8dac6e410a019f58fc452b262a184e8e7fd12 (diff)
downloadchromium_org-e5d81f57cb97b3b6b7fccc9c5610d21eb81db09d.tar.gz
Merge from Chromium at DEPS revision 261286
This commit was generated by merge_to_master.py. Change-Id: Iea9643ce91618057f128e9a5b62c07be152f2b89
Diffstat (limited to 'gpu')
-rw-r--r--gpu/command_buffer/client/client_test_helper.cc3
-rw-r--r--gpu/command_buffer/client/client_test_helper.h4
-rw-r--r--gpu/command_buffer/client/gl_in_process_context.cc10
-rw-r--r--gpu/command_buffer/client/gl_in_process_context.h1
-rw-r--r--gpu/command_buffer/client/gles2_implementation.cc35
-rw-r--r--gpu/command_buffer/client/gles2_implementation.h20
-rw-r--r--gpu/command_buffer/client/gles2_implementation_unittest.cc74
-rw-r--r--gpu/command_buffer/client/mapped_memory.cc1
-rw-r--r--gpu/command_buffer/client/mapped_memory_unittest.cc2
-rw-r--r--gpu/command_buffer/client/transfer_buffer.cc2
-rw-r--r--gpu/command_buffer/common/buffer.cc20
-rw-r--r--gpu/command_buffer/common/buffer.h41
-rw-r--r--gpu/command_buffer/common/command_buffer.h18
-rw-r--r--gpu/command_buffer/common/command_buffer_mock.h4
-rw-r--r--gpu/command_buffer/common/gles2_cmd_utils.cc32
-rw-r--r--gpu/command_buffer/common/gles2_cmd_utils.h1
-rw-r--r--gpu/command_buffer/gles2_utils.target.darwin-arm.mk2
-rw-r--r--gpu/command_buffer/gles2_utils.target.darwin-mips.mk2
-rw-r--r--gpu/command_buffer/gles2_utils.target.darwin-x86.mk2
-rw-r--r--gpu/command_buffer/gles2_utils.target.darwin-x86_64.mk2
-rw-r--r--gpu/command_buffer/gles2_utils.target.linux-arm.mk2
-rw-r--r--gpu/command_buffer/gles2_utils.target.linux-mips.mk2
-rw-r--r--gpu/command_buffer/gles2_utils.target.linux-x86.mk2
-rw-r--r--gpu/command_buffer/gles2_utils.target.linux-x86_64.mk2
-rw-r--r--gpu/command_buffer/service/command_buffer_service.cc27
-rw-r--r--gpu/command_buffer/service/command_buffer_service.h40
-rw-r--r--gpu/command_buffer/service/common_decoder_unittest.cc2
-rw-r--r--gpu/command_buffer/service/context_state.cc6
-rw-r--r--gpu/command_buffer/service/context_state.h5
-rw-r--r--gpu/command_buffer/service/error_state.cc14
-rw-r--r--gpu/command_buffer/service/error_state.h7
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder.cc23
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc1226
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc112
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h43
-rw-r--r--gpu/command_buffer/service/gpu_scheduler.cc2
-rw-r--r--gpu/command_buffer/service/gpu_scheduler.h6
-rw-r--r--gpu/command_buffer/service/gpu_scheduler_unittest.cc2
-rw-r--r--gpu/command_buffer/service/gpu_switches.cc4
-rw-r--r--gpu/command_buffer/service/gpu_switches.h1
-rw-r--r--gpu/command_buffer/service/in_process_command_buffer.cc18
-rw-r--r--gpu/command_buffer/service/in_process_command_buffer.h9
-rw-r--r--gpu/command_buffer/service/query_manager_unittest.cc3
-rw-r--r--gpu/command_buffer/service/shader_translator.cc17
-rw-r--r--gpu/command_buffer/service/transfer_buffer_manager.cc7
-rw-r--r--gpu/command_buffer/service/transfer_buffer_manager.h13
-rw-r--r--gpu/command_buffer/service/transfer_buffer_manager_unittest.cc51
-rw-r--r--gpu/command_buffer/tests/gl_gpu_memory_buffer_unittest.cc6
-rw-r--r--gpu/command_buffer/tests/gl_manager.cc17
-rw-r--r--gpu/command_buffer/tests/gl_manager.h2
-rw-r--r--gpu/command_buffer_client.target.darwin-arm.mk2
-rw-r--r--gpu/command_buffer_client.target.darwin-mips.mk2
-rw-r--r--gpu/command_buffer_client.target.darwin-x86.mk2
-rw-r--r--gpu/command_buffer_client.target.darwin-x86_64.mk2
-rw-r--r--gpu/command_buffer_client.target.linux-arm.mk2
-rw-r--r--gpu/command_buffer_client.target.linux-mips.mk2
-rw-r--r--gpu/command_buffer_client.target.linux-x86.mk2
-rw-r--r--gpu/command_buffer_client.target.linux-x86_64.mk2
-rw-r--r--gpu/command_buffer_common.target.darwin-arm.mk2
-rw-r--r--gpu/command_buffer_common.target.darwin-mips.mk2
-rw-r--r--gpu/command_buffer_common.target.darwin-x86.mk2
-rw-r--r--gpu/command_buffer_common.target.darwin-x86_64.mk2
-rw-r--r--gpu/command_buffer_common.target.linux-arm.mk2
-rw-r--r--gpu/command_buffer_common.target.linux-mips.mk2
-rw-r--r--gpu/command_buffer_common.target.linux-x86.mk2
-rw-r--r--gpu/command_buffer_common.target.linux-x86_64.mk2
-rw-r--r--gpu/command_buffer_service.target.darwin-arm.mk2
-rw-r--r--gpu/command_buffer_service.target.darwin-mips.mk2
-rw-r--r--gpu/command_buffer_service.target.darwin-x86.mk2
-rw-r--r--gpu/command_buffer_service.target.darwin-x86_64.mk2
-rw-r--r--gpu/command_buffer_service.target.linux-arm.mk2
-rw-r--r--gpu/command_buffer_service.target.linux-mips.mk2
-rw-r--r--gpu/command_buffer_service.target.linux-x86.mk2
-rw-r--r--gpu/command_buffer_service.target.linux-x86_64.mk2
-rw-r--r--gpu/config/gpu_control_list.cc95
-rw-r--r--gpu/config/gpu_control_list.h5
-rw-r--r--gpu/config/gpu_control_list_entry_unittest.cc330
-rw-r--r--gpu/config/gpu_control_list_format.txt3
-rw-r--r--gpu/config/gpu_driver_bug_list.cc45
-rw-r--r--gpu/config/gpu_driver_bug_list.h14
-rw-r--r--gpu/config/gpu_driver_bug_list_json.cc14
-rw-r--r--gpu/config/gpu_driver_bug_list_unittest.cc31
-rw-r--r--gpu/config/gpu_info.cc4
-rw-r--r--gpu/config/gpu_info.h4
-rw-r--r--gpu/config/gpu_info_collector_mac.mm32
-rw-r--r--gpu/config/gpu_util.cc21
-rw-r--r--gpu/config/gpu_util.h4
-rw-r--r--gpu/config/software_rendering_list_json.cc65
-rw-r--r--gpu/disk_cache_proto.target.darwin-arm.mk2
-rw-r--r--gpu/disk_cache_proto.target.darwin-mips.mk2
-rw-r--r--gpu/disk_cache_proto.target.darwin-x86.mk2
-rw-r--r--gpu/disk_cache_proto.target.darwin-x86_64.mk2
-rw-r--r--gpu/disk_cache_proto.target.linux-arm.mk2
-rw-r--r--gpu/disk_cache_proto.target.linux-mips.mk2
-rw-r--r--gpu/disk_cache_proto.target.linux-x86.mk2
-rw-r--r--gpu/disk_cache_proto.target.linux-x86_64.mk2
-rw-r--r--gpu/gles2_c_lib.target.darwin-arm.mk2
-rw-r--r--gpu/gles2_c_lib.target.darwin-mips.mk2
-rw-r--r--gpu/gles2_c_lib.target.darwin-x86.mk2
-rw-r--r--gpu/gles2_c_lib.target.darwin-x86_64.mk2
-rw-r--r--gpu/gles2_c_lib.target.linux-arm.mk2
-rw-r--r--gpu/gles2_c_lib.target.linux-mips.mk2
-rw-r--r--gpu/gles2_c_lib.target.linux-x86.mk2
-rw-r--r--gpu/gles2_c_lib.target.linux-x86_64.mk2
-rw-r--r--gpu/gles2_cmd_helper.target.darwin-arm.mk2
-rw-r--r--gpu/gles2_cmd_helper.target.darwin-mips.mk2
-rw-r--r--gpu/gles2_cmd_helper.target.darwin-x86.mk2
-rw-r--r--gpu/gles2_cmd_helper.target.darwin-x86_64.mk2
-rw-r--r--gpu/gles2_cmd_helper.target.linux-arm.mk2
-rw-r--r--gpu/gles2_cmd_helper.target.linux-mips.mk2
-rw-r--r--gpu/gles2_cmd_helper.target.linux-x86.mk2
-rw-r--r--gpu/gles2_cmd_helper.target.linux-x86_64.mk2
-rw-r--r--gpu/gles2_conform_support/egl/display.cc16
-rw-r--r--gpu/gles2_implementation.target.darwin-arm.mk2
-rw-r--r--gpu/gles2_implementation.target.darwin-mips.mk2
-rw-r--r--gpu/gles2_implementation.target.darwin-x86.mk2
-rw-r--r--gpu/gles2_implementation.target.darwin-x86_64.mk2
-rw-r--r--gpu/gles2_implementation.target.linux-arm.mk2
-rw-r--r--gpu/gles2_implementation.target.linux-mips.mk2
-rw-r--r--gpu/gles2_implementation.target.linux-x86.mk2
-rw-r--r--gpu/gles2_implementation.target.linux-x86_64.mk2
-rw-r--r--gpu/gpu.target.darwin-arm.mk2
-rw-r--r--gpu/gpu.target.darwin-mips.mk2
-rw-r--r--gpu/gpu.target.darwin-x86.mk2
-rw-r--r--gpu/gpu.target.darwin-x86_64.mk2
-rw-r--r--gpu/gpu.target.linux-arm.mk2
-rw-r--r--gpu/gpu.target.linux-mips.mk2
-rw-r--r--gpu/gpu.target.linux-x86.mk2
-rw-r--r--gpu/gpu.target.linux-x86_64.mk2
-rw-r--r--gpu/gpu_config.target.darwin-arm.mk2
-rw-r--r--gpu/gpu_config.target.darwin-mips.mk2
-rw-r--r--gpu/gpu_config.target.darwin-x86.mk2
-rw-r--r--gpu/gpu_config.target.darwin-x86_64.mk2
-rw-r--r--gpu/gpu_config.target.linux-arm.mk2
-rw-r--r--gpu/gpu_config.target.linux-mips.mk2
-rw-r--r--gpu/gpu_config.target.linux-x86.mk2
-rw-r--r--gpu/gpu_config.target.linux-x86_64.mk2
-rw-r--r--gpu/gpu_ipc.target.darwin-arm.mk2
-rw-r--r--gpu/gpu_ipc.target.darwin-mips.mk2
-rw-r--r--gpu/gpu_ipc.target.darwin-x86.mk2
-rw-r--r--gpu/gpu_ipc.target.darwin-x86_64.mk2
-rw-r--r--gpu/gpu_ipc.target.linux-arm.mk2
-rw-r--r--gpu/gpu_ipc.target.linux-mips.mk2
-rw-r--r--gpu/gpu_ipc.target.linux-x86.mk2
-rw-r--r--gpu/gpu_ipc.target.linux-x86_64.mk2
-rw-r--r--gpu/skia_bindings/gl_bindings_skia_cmd_buffer.cc1
-rw-r--r--gpu/skia_bindings/gpu_skia_bindings.target.darwin-arm.mk2
-rw-r--r--gpu/skia_bindings/gpu_skia_bindings.target.darwin-mips.mk2
-rw-r--r--gpu/skia_bindings/gpu_skia_bindings.target.darwin-x86.mk2
-rw-r--r--gpu/skia_bindings/gpu_skia_bindings.target.darwin-x86_64.mk2
-rw-r--r--gpu/skia_bindings/gpu_skia_bindings.target.linux-arm.mk2
-rw-r--r--gpu/skia_bindings/gpu_skia_bindings.target.linux-mips.mk2
-rw-r--r--gpu/skia_bindings/gpu_skia_bindings.target.linux-x86.mk2
-rw-r--r--gpu/skia_bindings/gpu_skia_bindings.target.linux-x86_64.mk2
154 files changed, 1559 insertions, 1248 deletions
diff --git a/gpu/command_buffer/client/client_test_helper.cc b/gpu/command_buffer/client/client_test_helper.cc
index f5e58f23ae..46011adaf5 100644
--- a/gpu/command_buffer/client/client_test_helper.cc
+++ b/gpu/command_buffer/client/client_test_helper.cc
@@ -75,7 +75,8 @@ scoped_refptr<gpu::Buffer> MockCommandBufferBase::CreateTransferBuffer(
int32 ndx = *id - kTransferBufferBaseId;
scoped_ptr<base::SharedMemory> shared_memory(new base::SharedMemory());
shared_memory->CreateAndMapAnonymous(size);
- transfer_buffer_buffers_[ndx] = new gpu::Buffer(shared_memory.Pass(), size);
+ transfer_buffer_buffers_[ndx] =
+ MakeBufferFromSharedMemory(shared_memory.Pass(), size);
}
return GetTransferBuffer(*id);
}
diff --git a/gpu/command_buffer/client/client_test_helper.h b/gpu/command_buffer/client/client_test_helper.h
index 33fae265a9..011d31f722 100644
--- a/gpu/command_buffer/client/client_test_helper.h
+++ b/gpu/command_buffer/client/client_test_helper.h
@@ -10,9 +10,9 @@
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
#include "gpu/command_buffer/common/cmd_buffer_common.h"
-#include "gpu/command_buffer/common/command_buffer.h"
#include "gpu/command_buffer/common/gpu_control.h"
#include "gpu/command_buffer/common/gpu_memory_allocation.h"
+#include "gpu/command_buffer/service/command_buffer_service.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -20,7 +20,7 @@ namespace gpu {
class CommandBufferHelper;
-class MockCommandBufferBase : public CommandBuffer {
+class MockCommandBufferBase : public CommandBufferServiceBase {
public:
static const int32 kTransferBufferBaseId = 0x123;
static const int32 kMaxTransferBuffers = 6;
diff --git a/gpu/command_buffer/client/gl_in_process_context.cc b/gpu/command_buffer/client/gl_in_process_context.cc
index 1db894ffdd..2b5e559ba6 100644
--- a/gpu/command_buffer/client/gl_in_process_context.cc
+++ b/gpu/command_buffer/client/gl_in_process_context.cc
@@ -147,6 +147,7 @@ bool GLInProcessContextImpl::Initialize(
// Chromium-specific attributes
const int32 FAIL_IF_MAJOR_PERF_CAVEAT = 0x10002;
+ const int32 LOSE_CONTEXT_WHEN_OUT_OF_MEMORY = 0x10003;
std::vector<int32> attrib_vector;
if (attribs.alpha_size >= 0) {
@@ -185,6 +186,10 @@ bool GLInProcessContextImpl::Initialize(
attrib_vector.push_back(FAIL_IF_MAJOR_PERF_CAVEAT);
attrib_vector.push_back(attribs.fail_if_major_perf_caveat);
}
+ if (attribs.lose_context_when_out_of_memory > 0) {
+ attrib_vector.push_back(LOSE_CONTEXT_WHEN_OUT_OF_MEMORY);
+ attrib_vector.push_back(attribs.lose_context_when_out_of_memory);
+ }
attrib_vector.push_back(NONE);
base::Closure wrapped_callback =
@@ -250,6 +255,7 @@ bool GLInProcessContextImpl::Initialize(
share_group,
transfer_buffer_.get(),
bind_generates_resources,
+ attribs.lose_context_when_out_of_memory > 0,
command_buffer_.get()));
if (use_global_share_group) {
@@ -302,7 +308,9 @@ GLInProcessContextAttribs::GLInProcessContextAttribs()
depth_size(-1),
stencil_size(-1),
samples(-1),
- sample_buffers(-1) {}
+ sample_buffers(-1),
+ fail_if_major_perf_caveat(-1),
+ lose_context_when_out_of_memory(-1) {}
// static
GLInProcessContext* GLInProcessContext::CreateContext(
diff --git a/gpu/command_buffer/client/gl_in_process_context.h b/gpu/command_buffer/client/gl_in_process_context.h
index 188ed34343..be91cfdc1a 100644
--- a/gpu/command_buffer/client/gl_in_process_context.h
+++ b/gpu/command_buffer/client/gl_in_process_context.h
@@ -42,6 +42,7 @@ struct GLES2_IMPL_EXPORT GLInProcessContextAttribs {
int32 samples;
int32 sample_buffers;
int32 fail_if_major_perf_caveat;
+ int32 lose_context_when_out_of_memory;
};
class GLES2_IMPL_EXPORT GLInProcessContext {
diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc
index 0dd5161662..194ccfe3f0 100644
--- a/gpu/command_buffer/client/gles2_implementation.cc
+++ b/gpu/command_buffer/client/gles2_implementation.cc
@@ -83,11 +83,12 @@ GLES2Implementation::SingleThreadChecker::~SingleThreadChecker() {
}
GLES2Implementation::GLES2Implementation(
- GLES2CmdHelper* helper,
- ShareGroup* share_group,
- TransferBufferInterface* transfer_buffer,
- bool bind_generates_resource,
- GpuControl* gpu_control)
+ GLES2CmdHelper* helper,
+ ShareGroup* share_group,
+ TransferBufferInterface* transfer_buffer,
+ bool bind_generates_resource,
+ bool lose_context_when_out_of_memory,
+ GpuControl* gpu_control)
: helper_(helper),
transfer_buffer_(transfer_buffer),
angle_pack_reverse_row_order_status_(kUnknownExtensionStatus),
@@ -113,6 +114,7 @@ GLES2Implementation::GLES2Implementation(
async_upload_sync_shm_offset_(0),
error_bits_(0),
debug_(false),
+ lose_context_when_out_of_memory_(lose_context_when_out_of_memory),
use_count_(0),
error_message_callback_(NULL),
gpu_control_(gpu_control),
@@ -504,6 +506,11 @@ void GLES2Implementation::SetGLError(
error_message_callback_->OnErrorMessage(temp.c_str(), 0);
}
error_bits_ |= GLES2Util::GLErrorToErrorBit(error);
+
+ if (error == GL_OUT_OF_MEMORY && lose_context_when_out_of_memory_) {
+ helper_->LoseContextCHROMIUM(GL_GUILTY_CONTEXT_RESET_ARB,
+ GL_UNKNOWN_CONTEXT_RESET_ARB);
+ }
}
void GLES2Implementation::SetGLErrorInvalidEnum(
@@ -891,16 +898,6 @@ void GLES2Implementation::ShallowFinishCHROMIUM() {
helper_->CommandBufferHelper::Finish();
}
-bool GLES2Implementation::MustBeContextLost() {
- bool context_lost = helper_->IsContextLost();
- if (!context_lost) {
- WaitForCmd();
- context_lost = helper_->IsContextLost();
- }
- CHECK(context_lost);
- return context_lost;
-}
-
void GLES2Implementation::FinishHelper() {
GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glFinish()");
TRACE_EVENT0("gpu", "GLES2::Finish");
@@ -3330,7 +3327,9 @@ void GLES2Implementation::BeginQueryEXT(GLenum target, GLuint id) {
if (!query) {
query = query_tracker_->CreateQuery(id, target);
if (!query) {
- MustBeContextLost();
+ SetGLError(GL_OUT_OF_MEMORY,
+ "glBeginQueryEXT",
+ "transfer buffer allocation failed");
return;
}
} else if (query->target() != target) {
@@ -4003,9 +4002,7 @@ void* GLES2Implementation::MapImageCHROMIUMHelper(GLuint image_id,
return NULL;
}
- void* mapped_buffer = NULL;
- gpu_buffer->Map(mode, &mapped_buffer);
- return mapped_buffer;
+ return gpu_buffer->Map(mode);
}
void* GLES2Implementation::MapImageCHROMIUM(
diff --git a/gpu/command_buffer/client/gles2_implementation.h b/gpu/command_buffer/client/gles2_implementation.h
index b120a62e1d..c8438027bd 100644
--- a/gpu/command_buffer/client/gles2_implementation.h
+++ b/gpu/command_buffer/client/gles2_implementation.h
@@ -180,12 +180,12 @@ class GLES2_IMPL_EXPORT GLES2Implementation
// Number of swap buffers allowed before waiting.
static const size_t kMaxSwapBuffers = 2;
- GLES2Implementation(
- GLES2CmdHelper* helper,
- ShareGroup* share_group,
- TransferBufferInterface* transfer_buffer,
- bool bind_generates_resource,
- GpuControl* gpu_control);
+ GLES2Implementation(GLES2CmdHelper* helper,
+ ShareGroup* share_group,
+ TransferBufferInterface* transfer_buffer,
+ bool bind_generates_resource,
+ bool lose_context_when_out_of_memory,
+ GpuControl* gpu_control);
virtual ~GLES2Implementation();
@@ -592,11 +592,6 @@ class GLES2_IMPL_EXPORT GLES2Implementation
void FinishHelper();
- // Asserts that the context is lost.
- // NOTE: This is an expensive call and should only be called
- // for error checking.
- bool MustBeContextLost();
-
void RunIfContextNotLost(const base::Closure& callback);
void OnSwapBuffersComplete();
@@ -729,6 +724,9 @@ class GLES2_IMPL_EXPORT GLES2Implementation
// Whether or not to print debugging info.
bool debug_;
+ // When true, the context is lost when a GL_OUT_OF_MEMORY error occurs.
+ bool lose_context_when_out_of_memory_;
+
// Used to check for single threaded access.
int use_count_;
diff --git a/gpu/command_buffer/client/gles2_implementation_unittest.cc b/gpu/command_buffer/client/gles2_implementation_unittest.cc
index aa9073388d..f57d07a8de 100644
--- a/gpu/command_buffer/client/gles2_implementation_unittest.cc
+++ b/gpu/command_buffer/client/gles2_implementation_unittest.cc
@@ -6,6 +6,8 @@
#include "gpu/command_buffer/client/gles2_implementation.h"
+#include <limits>
+
#include <GLES2/gl2ext.h>
#include <GLES2/gl2extchromium.h>
#include "base/compiler_specific.h"
@@ -390,7 +392,9 @@ class GLES2ImplementationTest : public testing::Test {
public:
TestContext() : commands_(NULL), token_(0) {}
- void Initialize(ShareGroup* share_group, bool bind_generates_resource) {
+ void Initialize(ShareGroup* share_group,
+ bool bind_generates_resource,
+ bool lose_context_when_out_of_memory) {
command_buffer_.reset(new StrictMock<MockClientCommandBuffer>());
ASSERT_TRUE(command_buffer_->Initialize());
@@ -439,12 +443,12 @@ class GLES2ImplementationTest : public testing::Test {
.RetiresOnSaturation();
GetNextToken(); // eat the token that starting up will use.
- gl_.reset(
- new GLES2Implementation(helper_.get(),
- share_group,
- transfer_buffer_.get(),
- bind_generates_resource,
- gpu_control_.get()));
+ gl_.reset(new GLES2Implementation(helper_.get(),
+ share_group,
+ transfer_buffer_.get(),
+ bind_generates_resource,
+ lose_context_when_out_of_memory,
+ gpu_control_.get()));
ASSERT_TRUE(gl_->Initialize(kTransferBufferSize,
kTransferBufferSize,
kTransferBufferSize,
@@ -514,11 +518,14 @@ class GLES2ImplementationTest : public testing::Test {
return gl_->query_tracker_->GetQuery(id);
}
- void Initialize(bool bind_generates_resource) {
+ void Initialize(bool bind_generates_resource,
+ bool lose_context_when_out_of_memory) {
share_group_ = new ShareGroup(bind_generates_resource);
for (int i = 0; i < kNumTestContexts; i++)
- test_contexts_[i].Initialize(share_group_.get(), bind_generates_resource);
+ test_contexts_[i].Initialize(share_group_.get(),
+ bind_generates_resource,
+ lose_context_when_out_of_memory);
// Default to test context 0.
gpu_control_ = test_contexts_[0].gpu_control_.get();
@@ -585,7 +592,9 @@ class GLES2ImplementationTest : public testing::Test {
};
void GLES2ImplementationTest::SetUp() {
- Initialize(true);
+ bool bind_generates_resource = true;
+ bool lose_context_when_out_of_memory = false;
+ Initialize(bind_generates_resource, lose_context_when_out_of_memory);
}
void GLES2ImplementationTest::TearDown() {
@@ -593,6 +602,11 @@ void GLES2ImplementationTest::TearDown() {
test_contexts_[i].TearDown();
}
+class GLES2ImplementationManualInitTest : public GLES2ImplementationTest {
+ protected:
+ virtual void SetUp() OVERRIDE {}
+};
+
class GLES2ImplementationStrictSharedTest : public GLES2ImplementationTest {
protected:
virtual void SetUp() OVERRIDE;
@@ -683,7 +697,9 @@ class GLES2ImplementationStrictSharedTest : public GLES2ImplementationTest {
};
void GLES2ImplementationStrictSharedTest::SetUp() {
- Initialize(false);
+ bool bind_generates_resource = false;
+ bool lose_context_when_out_of_memory = false;
+ Initialize(bind_generates_resource, lose_context_when_out_of_memory);
}
// GCC requires these declarations, but MSVC requires they not be present
@@ -3100,6 +3116,42 @@ TEST_F(GLES2ImplementationTest, ProduceTextureCHROMIUM) {
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
}
+TEST_F(GLES2ImplementationManualInitTest, LoseContextOnOOM) {
+ bool bind_generates_resource = false;
+ bool lose_context_when_out_of_memory = true;
+ Initialize(bind_generates_resource, lose_context_when_out_of_memory);
+
+ struct Cmds {
+ cmds::LoseContextCHROMIUM cmd;
+ };
+
+ GLsizei max = std::numeric_limits<GLsizei>::max();
+ EXPECT_CALL(*gpu_control_, CreateGpuMemoryBuffer(max, max, _, _))
+ .WillOnce(Return(static_cast<gfx::GpuMemoryBuffer*>(NULL)));
+ gl_->CreateImageCHROMIUM(max, max, 0);
+ // The context should be lost.
+ Cmds expected;
+ expected.cmd.Init(GL_GUILTY_CONTEXT_RESET_ARB, GL_UNKNOWN_CONTEXT_RESET_ARB);
+ EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+}
+
+TEST_F(GLES2ImplementationManualInitTest, NoLoseContextOnOOM) {
+ bool bind_generates_resource = false;
+ bool lose_context_when_out_of_memory = false;
+ Initialize(bind_generates_resource, lose_context_when_out_of_memory);
+
+ struct Cmds {
+ cmds::LoseContextCHROMIUM cmd;
+ };
+
+ GLsizei max = std::numeric_limits<GLsizei>::max();
+ EXPECT_CALL(*gpu_control_, CreateGpuMemoryBuffer(max, max, _, _))
+ .WillOnce(Return(static_cast<gfx::GpuMemoryBuffer*>(NULL)));
+ gl_->CreateImageCHROMIUM(max, max, 0);
+ // The context should not be lost.
+ EXPECT_TRUE(NoCommandsWritten());
+}
+
#include "gpu/command_buffer/client/gles2_implementation_unittest_autogen.h"
} // namespace gles2
diff --git a/gpu/command_buffer/client/mapped_memory.cc b/gpu/command_buffer/client/mapped_memory.cc
index b62ca27e4b..7166733c51 100644
--- a/gpu/command_buffer/client/mapped_memory.cc
+++ b/gpu/command_buffer/client/mapped_memory.cc
@@ -91,6 +91,7 @@ void* MappedMemoryManager::Alloc(
cmd_buf->CreateTransferBuffer(chunk_size, &id);
if (id < 0)
return NULL;
+ DCHECK(shm);
MemoryChunk* mc = new MemoryChunk(id, shm, helper_, poll_callback_);
allocated_memory_ += mc->GetSize();
chunks_.push_back(mc);
diff --git a/gpu/command_buffer/client/mapped_memory_unittest.cc b/gpu/command_buffer/client/mapped_memory_unittest.cc
index d85311910d..4ebe5ec2fc 100644
--- a/gpu/command_buffer/client/mapped_memory_unittest.cc
+++ b/gpu/command_buffer/client/mapped_memory_unittest.cc
@@ -102,7 +102,7 @@ class MemoryChunkTest : public MappedMemoryTestBase {
MappedMemoryTestBase::SetUp();
scoped_ptr<base::SharedMemory> shared_memory(new base::SharedMemory());
shared_memory->CreateAndMapAnonymous(kBufferSize);
- buffer_ = new gpu::Buffer(shared_memory.Pass(), kBufferSize);
+ buffer_ = MakeBufferFromSharedMemory(shared_memory.Pass(), kBufferSize);
chunk_.reset(new MemoryChunk(kShmId,
buffer_,
helper_.get(),
diff --git a/gpu/command_buffer/client/transfer_buffer.cc b/gpu/command_buffer/client/transfer_buffer.cc
index da3996beeb..22a31c8c1a 100644
--- a/gpu/command_buffer/client/transfer_buffer.cc
+++ b/gpu/command_buffer/client/transfer_buffer.cc
@@ -67,6 +67,7 @@ void TransferBuffer::Free() {
}
bool TransferBuffer::HaveBuffer() const {
+ DCHECK(buffer_id_ == -1 || buffer_);
return buffer_id_ != -1;
}
@@ -88,6 +89,7 @@ void TransferBuffer::AllocateRingBuffer(unsigned int size) {
scoped_refptr<gpu::Buffer> buffer =
helper_->command_buffer()->CreateTransferBuffer(size, &id);
if (id != -1) {
+ DCHECK(buffer);
buffer_ = buffer;
ring_buffer_.reset(new AlignedRingBuffer(
alignment_,
diff --git a/gpu/command_buffer/common/buffer.cc b/gpu/command_buffer/common/buffer.cc
index bbf40a1c7e..3b3da4345d 100644
--- a/gpu/command_buffer/common/buffer.cc
+++ b/gpu/command_buffer/common/buffer.cc
@@ -9,11 +9,23 @@
#include "base/numerics/safe_math.h"
namespace gpu {
+SharedMemoryBufferBacking::SharedMemoryBufferBacking(
+ scoped_ptr<base::SharedMemory> shared_memory,
+ size_t size)
+ : shared_memory_(shared_memory.Pass()), size_(size) {}
-Buffer::Buffer(scoped_ptr<base::SharedMemory> shared_memory, size_t size)
- : shared_memory_(shared_memory.Pass()),
- memory_(shared_memory_->memory()),
- size_(size) {
+SharedMemoryBufferBacking::~SharedMemoryBufferBacking() {}
+
+void* SharedMemoryBufferBacking::GetMemory() const {
+ return shared_memory_->memory();
+}
+
+size_t SharedMemoryBufferBacking::GetSize() const { return size_; }
+
+Buffer::Buffer(scoped_ptr<BufferBacking> backing)
+ : backing_(backing.Pass()),
+ memory_(backing_->GetMemory()),
+ size_(backing_->GetSize()) {
DCHECK(memory_) << "The memory must be mapped to create a Buffer";
}
diff --git a/gpu/command_buffer/common/buffer.h b/gpu/command_buffer/common/buffer.h
index e9a15580fd..5a310351b4 100644
--- a/gpu/command_buffer/common/buffer.h
+++ b/gpu/command_buffer/common/buffer.h
@@ -17,12 +17,34 @@ namespace base {
namespace gpu {
+class GPU_EXPORT BufferBacking {
+ public:
+ virtual ~BufferBacking() {}
+ virtual void* GetMemory() const = 0;
+ virtual size_t GetSize() const = 0;
+};
+
+class GPU_EXPORT SharedMemoryBufferBacking : public BufferBacking {
+ public:
+ SharedMemoryBufferBacking(scoped_ptr<base::SharedMemory> shared_memory,
+ size_t size);
+ virtual ~SharedMemoryBufferBacking();
+ virtual void* GetMemory() const OVERRIDE;
+ virtual size_t GetSize() const OVERRIDE;
+ base::SharedMemory* shared_memory() { return shared_memory_.get(); }
+
+ private:
+ scoped_ptr<base::SharedMemory> shared_memory_;
+ size_t size_;
+ DISALLOW_COPY_AND_ASSIGN(SharedMemoryBufferBacking);
+};
+
// Buffer owns a piece of shared-memory of a certain size.
class GPU_EXPORT Buffer : public base::RefCountedThreadSafe<Buffer> {
public:
- Buffer(scoped_ptr<base::SharedMemory> shared_memory, size_t size);
+ explicit Buffer(scoped_ptr<BufferBacking> backing);
- base::SharedMemory* shared_memory() const { return shared_memory_.get(); }
+ BufferBacking* backing() const { return backing_.get(); }
void* memory() const { return memory_; }
size_t size() const { return size_; }
@@ -33,13 +55,26 @@ class GPU_EXPORT Buffer : public base::RefCountedThreadSafe<Buffer> {
friend class base::RefCountedThreadSafe<Buffer>;
~Buffer();
- scoped_ptr<base::SharedMemory> shared_memory_;
+ scoped_ptr<BufferBacking> backing_;
void* memory_;
size_t size_;
DISALLOW_COPY_AND_ASSIGN(Buffer);
};
+static inline scoped_ptr<BufferBacking> MakeBackingFromSharedMemory(
+ scoped_ptr<base::SharedMemory> shared_memory,
+ size_t size) {
+ return scoped_ptr<BufferBacking>(
+ new SharedMemoryBufferBacking(shared_memory.Pass(), size));
+}
+
+static inline scoped_refptr<Buffer> MakeBufferFromSharedMemory(
+ scoped_ptr<base::SharedMemory> shared_memory,
+ size_t size) {
+ return new Buffer(MakeBackingFromSharedMemory(shared_memory.Pass(), size));
+}
+
} // namespace gpu
#endif // GPU_COMMAND_BUFFER_COMMON_BUFFER_H_
diff --git a/gpu/command_buffer/common/command_buffer.h b/gpu/command_buffer/common/command_buffer.h
index 10f6026064..74cefe8322 100644
--- a/gpu/command_buffer/common/command_buffer.h
+++ b/gpu/command_buffer/common/command_buffer.h
@@ -113,9 +113,6 @@ class GPU_EXPORT CommandBuffer {
// Also resets the get and put offsets to 0.
virtual void SetGetBuffer(int32 transfer_buffer_id) = 0;
- // Sets the current get offset. This can be called from any thread.
- virtual void SetGetOffset(int32 get_offset) = 0;
-
// Create a transfer buffer of the given size. Returns its ID or -1 on
// error.
virtual scoped_refptr<gpu::Buffer> CreateTransferBuffer(size_t size,
@@ -124,21 +121,6 @@ class GPU_EXPORT CommandBuffer {
// Destroy a transfer buffer. The ID must be positive.
virtual void DestroyTransferBuffer(int32 id) = 0;
- // Get the transfer buffer associated with an ID. Returns a null buffer for
- // ID 0.
- virtual scoped_refptr<gpu::Buffer> GetTransferBuffer(int32 id) = 0;
-
- // Allows the reader to update the current token value.
- virtual void SetToken(int32 token) = 0;
-
- // Allows the reader to set the current parse error.
- virtual void SetParseError(error::Error) = 0;
-
- // Allows the reader to set the current context lost reason.
- // NOTE: if calling this in conjunction with SetParseError,
- // call this first.
- virtual void SetContextLostReason(error::ContextLostReason) = 0;
-
// The NaCl Win64 build only really needs the struct definitions above; having
// GetLastError declared would mean we'd have to also define it, and pull more
// of gpu in to the NaCl Win64 build.
diff --git a/gpu/command_buffer/common/command_buffer_mock.h b/gpu/command_buffer/common/command_buffer_mock.h
index 50c6f5b35f..7583b03dbf 100644
--- a/gpu/command_buffer/common/command_buffer_mock.h
+++ b/gpu/command_buffer/common/command_buffer_mock.h
@@ -5,7 +5,7 @@
#ifndef GPU_COMMAND_BUFFER_COMMON_COMMAND_BUFFER_MOCK_H_
#define GPU_COMMAND_BUFFER_COMMON_COMMAND_BUFFER_MOCK_H_
-#include "gpu/command_buffer/common/command_buffer.h"
+#include "gpu/command_buffer/service/command_buffer_service.h"
#include "testing/gmock/include/gmock/gmock.h"
namespace base {
@@ -16,7 +16,7 @@ namespace gpu {
// An NPObject that implements a shared memory command buffer and a synchronous
// API to manage the put and get pointers.
-class MockCommandBuffer : public CommandBuffer {
+class MockCommandBuffer : public CommandBufferServiceBase {
public:
MockCommandBuffer();
virtual ~MockCommandBuffer();
diff --git a/gpu/command_buffer/common/gles2_cmd_utils.cc b/gpu/command_buffer/common/gles2_cmd_utils.cc
index f310d474d7..97bc081a18 100644
--- a/gpu/command_buffer/common/gles2_cmd_utils.cc
+++ b/gpu/command_buffer/common/gles2_cmd_utils.cc
@@ -774,23 +774,24 @@ const int32 kBufferDestroyed = 0x3095; // EGL_BUFFER_DESTROYED
const int32 kShareResources = 0x10000;
const int32 kBindGeneratesResource = 0x10001;
const int32 kFailIfMajorPerfCaveat = 0x10002;
+const int32 kLoseContextWhenOutOfMemory = 0x10003;
} // namespace
ContextCreationAttribHelper::ContextCreationAttribHelper()
- : alpha_size_(-1),
- blue_size_(-1),
- green_size_(-1),
- red_size_(-1),
- depth_size_(-1),
- stencil_size_(-1),
- samples_(-1),
- sample_buffers_(-1),
- buffer_preserved_(true),
- share_resources_(false),
- bind_generates_resource_(true),
- fail_if_major_perf_caveat_(false) {
-}
+ : alpha_size_(-1),
+ blue_size_(-1),
+ green_size_(-1),
+ red_size_(-1),
+ depth_size_(-1),
+ stencil_size_(-1),
+ samples_(-1),
+ sample_buffers_(-1),
+ buffer_preserved_(true),
+ share_resources_(false),
+ bind_generates_resource_(true),
+ fail_if_major_perf_caveat_(false),
+ lose_context_when_out_of_memory_(false) {}
void ContextCreationAttribHelper::Serialize(std::vector<int32>* attribs) {
if (alpha_size_ != -1) {
@@ -833,6 +834,8 @@ void ContextCreationAttribHelper::Serialize(std::vector<int32>* attribs) {
attribs->push_back(bind_generates_resource_ ? 1 : 0);
attribs->push_back(kFailIfMajorPerfCaveat);
attribs->push_back(fail_if_major_perf_caveat_ ? 1 : 0);
+ attribs->push_back(kLoseContextWhenOutOfMemory);
+ attribs->push_back(lose_context_when_out_of_memory_ ? 1 : 0);
attribs->push_back(kNone);
}
@@ -887,6 +890,9 @@ bool ContextCreationAttribHelper::Parse(const std::vector<int32>& attribs) {
case kFailIfMajorPerfCaveat:
fail_if_major_perf_caveat_ = value != 0;
break;
+ case kLoseContextWhenOutOfMemory:
+ lose_context_when_out_of_memory_ = value != 0;
+ break;
case kNone:
// Terminate list, even if more attributes.
return true;
diff --git a/gpu/command_buffer/common/gles2_cmd_utils.h b/gpu/command_buffer/common/gles2_cmd_utils.h
index 59b5d96de8..0df1f31483 100644
--- a/gpu/command_buffer/common/gles2_cmd_utils.h
+++ b/gpu/command_buffer/common/gles2_cmd_utils.h
@@ -199,6 +199,7 @@ class GLES2_UTILS_EXPORT ContextCreationAttribHelper {
bool share_resources_;
bool bind_generates_resource_;
bool fail_if_major_perf_caveat_;
+ bool lose_context_when_out_of_memory_;
};
} // namespace gles2
diff --git a/gpu/command_buffer/gles2_utils.target.darwin-arm.mk b/gpu/command_buffer/gles2_utils.target.darwin-arm.mk
index 31687e9f70..568ec70f36 100644
--- a/gpu/command_buffer/gles2_utils.target.darwin-arm.mk
+++ b/gpu/command_buffer/gles2_utils.target.darwin-arm.mk
@@ -70,6 +70,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -158,6 +159,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/command_buffer/gles2_utils.target.darwin-mips.mk b/gpu/command_buffer/gles2_utils.target.darwin-mips.mk
index 67bc15e6ba..407b440186 100644
--- a/gpu/command_buffer/gles2_utils.target.darwin-mips.mk
+++ b/gpu/command_buffer/gles2_utils.target.darwin-mips.mk
@@ -69,6 +69,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -156,6 +157,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/command_buffer/gles2_utils.target.darwin-x86.mk b/gpu/command_buffer/gles2_utils.target.darwin-x86.mk
index e5e395e57b..b012a90c85 100644
--- a/gpu/command_buffer/gles2_utils.target.darwin-x86.mk
+++ b/gpu/command_buffer/gles2_utils.target.darwin-x86.mk
@@ -71,6 +71,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -159,6 +160,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/command_buffer/gles2_utils.target.darwin-x86_64.mk b/gpu/command_buffer/gles2_utils.target.darwin-x86_64.mk
index 484e0406f9..5429e8b4f9 100644
--- a/gpu/command_buffer/gles2_utils.target.darwin-x86_64.mk
+++ b/gpu/command_buffer/gles2_utils.target.darwin-x86_64.mk
@@ -71,6 +71,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -159,6 +160,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/command_buffer/gles2_utils.target.linux-arm.mk b/gpu/command_buffer/gles2_utils.target.linux-arm.mk
index 31687e9f70..568ec70f36 100644
--- a/gpu/command_buffer/gles2_utils.target.linux-arm.mk
+++ b/gpu/command_buffer/gles2_utils.target.linux-arm.mk
@@ -70,6 +70,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -158,6 +159,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/command_buffer/gles2_utils.target.linux-mips.mk b/gpu/command_buffer/gles2_utils.target.linux-mips.mk
index 67bc15e6ba..407b440186 100644
--- a/gpu/command_buffer/gles2_utils.target.linux-mips.mk
+++ b/gpu/command_buffer/gles2_utils.target.linux-mips.mk
@@ -69,6 +69,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -156,6 +157,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/command_buffer/gles2_utils.target.linux-x86.mk b/gpu/command_buffer/gles2_utils.target.linux-x86.mk
index e5e395e57b..b012a90c85 100644
--- a/gpu/command_buffer/gles2_utils.target.linux-x86.mk
+++ b/gpu/command_buffer/gles2_utils.target.linux-x86.mk
@@ -71,6 +71,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -159,6 +160,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/command_buffer/gles2_utils.target.linux-x86_64.mk b/gpu/command_buffer/gles2_utils.target.linux-x86_64.mk
index 484e0406f9..5429e8b4f9 100644
--- a/gpu/command_buffer/gles2_utils.target.linux-x86_64.mk
+++ b/gpu/command_buffer/gles2_utils.target.linux-x86_64.mk
@@ -71,6 +71,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -159,6 +160,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/command_buffer/service/command_buffer_service.cc b/gpu/command_buffer/service/command_buffer_service.cc
index 58b96ac21d..30617c8ffa 100644
--- a/gpu/command_buffer/service/command_buffer_service.cc
+++ b/gpu/command_buffer/service/command_buffer_service.cc
@@ -88,10 +88,12 @@ void CommandBufferService::Flush(int32 put_offset) {
void CommandBufferService::SetGetBuffer(int32 transfer_buffer_id) {
DCHECK_EQ(-1, ring_buffer_id_);
DCHECK_EQ(put_offset_, get_offset_); // Only if it's empty.
+ // If the buffer is invalid we handle it gracefully.
+ // This means ring_buffer_ can be NULL.
ring_buffer_ = GetTransferBuffer(transfer_buffer_id);
- DCHECK(ring_buffer_);
ring_buffer_id_ = transfer_buffer_id;
- num_entries_ = ring_buffer_->size() / sizeof(CommandBufferEntry);
+ int32 size = ring_buffer_ ? ring_buffer_->size() : 0;
+ num_entries_ = size / sizeof(CommandBufferEntry);
put_offset_ = 0;
SetGetOffset(0);
if (!get_buffer_change_callback_.is_null()) {
@@ -101,17 +103,15 @@ void CommandBufferService::SetGetBuffer(int32 transfer_buffer_id) {
UpdateState();
}
-bool CommandBufferService::SetSharedStateBuffer(
- scoped_ptr<base::SharedMemory> shared_state_shm) {
- shared_state_shm_.reset(shared_state_shm.release());
- if (!shared_state_shm_->Map(sizeof(*shared_state_)))
- return false;
+void CommandBufferService::SetSharedStateBuffer(
+ scoped_ptr<BufferBacking> shared_state_buffer) {
+ shared_state_buffer_ = shared_state_buffer.Pass();
+ DCHECK(shared_state_buffer_->GetSize() >= sizeof(*shared_state_));
shared_state_ =
- static_cast<CommandBufferSharedState*>(shared_state_shm_->memory());
+ static_cast<CommandBufferSharedState*>(shared_state_buffer_->GetMemory());
UpdateState();
- return true;
}
void CommandBufferService::SetGetOffset(int32 get_offset) {
@@ -130,7 +130,8 @@ scoped_refptr<Buffer> CommandBufferService::CreateTransferBuffer(size_t size,
static int32 next_id = 1;
*id = next_id++;
- if (!RegisterTransferBuffer(*id, shared_memory.Pass(), size)) {
+ if (!RegisterTransferBuffer(
+ *id, MakeBackingFromSharedMemory(shared_memory.Pass(), size))) {
*id = -1;
return NULL;
}
@@ -155,10 +156,8 @@ scoped_refptr<Buffer> CommandBufferService::GetTransferBuffer(int32 id) {
bool CommandBufferService::RegisterTransferBuffer(
int32 id,
- scoped_ptr<base::SharedMemory> shared_memory,
- size_t size) {
- return transfer_buffer_manager_->RegisterTransferBuffer(
- id, shared_memory.Pass(), size);
+ scoped_ptr<BufferBacking> buffer) {
+ return transfer_buffer_manager_->RegisterTransferBuffer(id, buffer.Pass());
}
void CommandBufferService::SetToken(int32 token) {
diff --git a/gpu/command_buffer/service/command_buffer_service.h b/gpu/command_buffer/service/command_buffer_service.h
index 15c38dd4b5..740e89717a 100644
--- a/gpu/command_buffer/service/command_buffer_service.h
+++ b/gpu/command_buffer/service/command_buffer_service.h
@@ -14,9 +14,30 @@ namespace gpu {
class TransferBufferManagerInterface;
+class GPU_EXPORT CommandBufferServiceBase : public CommandBuffer {
+ public:
+ // Sets the current get offset. This can be called from any thread.
+ virtual void SetGetOffset(int32 get_offset) = 0;
+
+ // Get the transfer buffer associated with an ID. Returns a null buffer for
+ // ID 0.
+ virtual scoped_refptr<gpu::Buffer> GetTransferBuffer(int32 id) = 0;
+
+ // Allows the reader to update the current token value.
+ virtual void SetToken(int32 token) = 0;
+
+ // Allows the reader to set the current parse error.
+ virtual void SetParseError(error::Error) = 0;
+
+ // Allows the reader to set the current context lost reason.
+ // NOTE: if calling this in conjunction with SetParseError,
+ // call this first.
+ virtual void SetContextLostReason(error::ContextLostReason) = 0;
+};
+
// An object that implements a shared memory command buffer and a synchronous
// API to manage the put and get pointers.
-class GPU_EXPORT CommandBufferService : public CommandBuffer {
+class GPU_EXPORT CommandBufferService : public CommandBufferServiceBase {
public:
typedef base::Callback<bool(int32)> GetBufferChangedCallback;
explicit CommandBufferService(
@@ -32,10 +53,12 @@ class GPU_EXPORT CommandBufferService : public CommandBuffer {
virtual void WaitForTokenInRange(int32 start, int32 end) OVERRIDE;
virtual void WaitForGetOffsetInRange(int32 start, int32 end) OVERRIDE;
virtual void SetGetBuffer(int32 transfer_buffer_id) OVERRIDE;
- virtual void SetGetOffset(int32 get_offset) OVERRIDE;
virtual scoped_refptr<Buffer> CreateTransferBuffer(size_t size,
int32* id) OVERRIDE;
virtual void DestroyTransferBuffer(int32 id) OVERRIDE;
+
+ // CommandBufferServiceBase implementation:
+ virtual void SetGetOffset(int32 get_offset) OVERRIDE;
virtual scoped_refptr<Buffer> GetTransferBuffer(int32 id) OVERRIDE;
virtual void SetToken(int32 token) OVERRIDE;
virtual void SetParseError(error::Error error) OVERRIDE;
@@ -56,22 +79,19 @@ class GPU_EXPORT CommandBufferService : public CommandBuffer {
virtual void SetParseErrorCallback(const base::Closure& callback);
// Setup the shared memory that shared state should be copied into.
- bool SetSharedStateBuffer(scoped_ptr<base::SharedMemory> shared_state_shm);
+ void SetSharedStateBuffer(scoped_ptr<BufferBacking> shared_state_buffer);
// Copy the current state into the shared state transfer buffer.
void UpdateState();
- // Register an existing shared memory object and get an ID that can be used
- // to identify it in the command buffer. Callee dups the handle until
- // DestroyTransferBuffer is called.
- bool RegisterTransferBuffer(int32 id,
- scoped_ptr<base::SharedMemory> shared_memory,
- size_t size);
+ // Registers an existing shared memory object and get an ID that can be used
+ // to identify it in the command buffer.
+ bool RegisterTransferBuffer(int32 id, scoped_ptr<BufferBacking> buffer);
private:
int32 ring_buffer_id_;
scoped_refptr<Buffer> ring_buffer_;
- scoped_ptr<base::SharedMemory> shared_state_shm_;
+ scoped_ptr<BufferBacking> shared_state_buffer_;
CommandBufferSharedState* shared_state_;
int32 num_entries_;
int32 get_offset_;
diff --git a/gpu/command_buffer/service/common_decoder_unittest.cc b/gpu/command_buffer/service/common_decoder_unittest.cc
index 5e89a5f2a8..11274e05f0 100644
--- a/gpu/command_buffer/service/common_decoder_unittest.cc
+++ b/gpu/command_buffer/service/common_decoder_unittest.cc
@@ -83,7 +83,7 @@ class MockCommandBufferEngine : public CommandBufferEngine {
get_offset_(0) {
scoped_ptr<base::SharedMemory> shared_memory(new base::SharedMemory());
shared_memory->CreateAndMapAnonymous(kBufferSize);
- buffer_ = new gpu::Buffer(shared_memory.Pass(), kBufferSize);
+ buffer_ = MakeBufferFromSharedMemory(shared_memory.Pass(), kBufferSize);
}
// Overridden from CommandBufferEngine.
diff --git a/gpu/command_buffer/service/context_state.cc b/gpu/command_buffer/service/context_state.cc
index f046872a72..6c929de67f 100644
--- a/gpu/command_buffer/service/context_state.cc
+++ b/gpu/command_buffer/service/context_state.cc
@@ -87,12 +87,14 @@ TextureUnit::TextureUnit()
TextureUnit::~TextureUnit() {
}
-ContextState::ContextState(FeatureInfo* feature_info, Logger* logger)
+ContextState::ContextState(FeatureInfo* feature_info,
+ ErrorStateClient* error_state_client,
+ Logger* logger)
: active_texture_unit(0),
pack_reverse_row_order(false),
fbo_binding_for_scissor_workaround_dirty_(false),
feature_info_(feature_info),
- error_state_(ErrorState::Create(logger)) {
+ error_state_(ErrorState::Create(error_state_client, logger)) {
Initialize();
}
diff --git a/gpu/command_buffer/service/context_state.h b/gpu/command_buffer/service/context_state.h
index 2697e15542..2c1f0e172c 100644
--- a/gpu/command_buffer/service/context_state.h
+++ b/gpu/command_buffer/service/context_state.h
@@ -22,6 +22,7 @@ namespace gles2 {
class Buffer;
class ErrorState;
+class ErrorStateClient;
class FeatureInfo;
class Framebuffer;
class Program;
@@ -93,7 +94,9 @@ struct Vec4 {
};
struct GPU_EXPORT ContextState {
- ContextState(FeatureInfo* feature_info, Logger* logger);
+ ContextState(FeatureInfo* feature_info,
+ ErrorStateClient* error_state_client,
+ Logger* logger);
~ContextState();
void Initialize();
diff --git a/gpu/command_buffer/service/error_state.cc b/gpu/command_buffer/service/error_state.cc
index 3468c7e7c6..ce65aa194d 100644
--- a/gpu/command_buffer/service/error_state.cc
+++ b/gpu/command_buffer/service/error_state.cc
@@ -16,7 +16,7 @@ namespace gles2 {
class ErrorStateImpl : public ErrorState {
public:
- explicit ErrorStateImpl(Logger* logger);
+ explicit ErrorStateImpl(ErrorStateClient* client, Logger* logger);
virtual ~ErrorStateImpl();
virtual uint32 GetGLError() OVERRIDE;
@@ -63,6 +63,7 @@ class ErrorStateImpl : public ErrorState {
// Current GL error bits.
uint32 error_bits_;
+ ErrorStateClient* client_;
Logger* logger_;
DISALLOW_COPY_AND_ASSIGN(ErrorStateImpl);
@@ -72,13 +73,12 @@ ErrorState::ErrorState() {}
ErrorState::~ErrorState() {}
-ErrorState* ErrorState::Create(Logger* logger) {
- return new ErrorStateImpl(logger);
+ErrorState* ErrorState::Create(ErrorStateClient* client, Logger* logger) {
+ return new ErrorStateImpl(client, logger);
}
-ErrorStateImpl::ErrorStateImpl(Logger* logger)
- : error_bits_(0),
- logger_(logger) {}
+ErrorStateImpl::ErrorStateImpl(ErrorStateClient* client, Logger* logger)
+ : error_bits_(0), client_(client), logger_(logger) {}
ErrorStateImpl::~ErrorStateImpl() {}
@@ -125,6 +125,8 @@ void ErrorStateImpl::SetGLError(
function_name + ": " + msg);
}
error_bits_ |= GLES2Util::GLErrorToErrorBit(error);
+ if (error == GL_OUT_OF_MEMORY)
+ client_->OnOutOfMemoryError();
}
void ErrorStateImpl::SetGLErrorInvalidEnum(
diff --git a/gpu/command_buffer/service/error_state.h b/gpu/command_buffer/service/error_state.h
index c4ef691925..0e6a4b067a 100644
--- a/gpu/command_buffer/service/error_state.h
+++ b/gpu/command_buffer/service/error_state.h
@@ -55,12 +55,17 @@ class Logger;
#define ERRORSTATE_CLEAR_REAL_GL_ERRORS(error_state, function_name) \
error_state->ClearRealGLErrors(__FILE__, __LINE__, function_name)
+class GPU_EXPORT ErrorStateClient {
+ public:
+ // GL_OUT_OF_MEMORY can cause side effects such as losing the context.
+ virtual void OnOutOfMemoryError() = 0;
+};
class GPU_EXPORT ErrorState {
public:
virtual ~ErrorState();
- static ErrorState* Create(Logger* logger);
+ static ErrorState* Create(ErrorStateClient* client, Logger* logger);
virtual uint32 GetGLError() = 0;
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index c3bdae5d5d..c0e0e3d798 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -566,7 +566,8 @@ void GLES2Decoder::EndDecoding() {}
// This class implements GLES2Decoder so we don't have to expose all the GLES2
// cmd stuff to outside this class.
class GLES2DecoderImpl : public GLES2Decoder,
- public FramebufferManager::TextureDetachObserver {
+ public FramebufferManager::TextureDetachObserver,
+ public ErrorStateClient {
public:
explicit GLES2DecoderImpl(ContextGroup* group);
virtual ~GLES2DecoderImpl();
@@ -694,6 +695,9 @@ class GLES2DecoderImpl : public GLES2Decoder,
virtual void OnTextureRefDetachedFromFramebuffer(
TextureRef* texture) OVERRIDE;
+ // Overriden from ErrorStateClient.
+ virtual void OnOutOfMemoryError() OVERRIDE;
+
// Helpers to facilitate calling into compatible extensions.
static void RenderbufferStorageMultisampleHelper(
const FeatureInfo* feature_info,
@@ -1752,6 +1756,9 @@ class GLES2DecoderImpl : public GLES2Decoder,
bool compile_shader_always_succeeds_;
+ // An optional behaviour to lose the context and group when OOM.
+ bool lose_context_when_out_of_memory_;
+
// Log extra info.
bool service_logging_;
@@ -2217,7 +2224,7 @@ GLES2DecoderImpl::GLES2DecoderImpl(ContextGroup* group)
: GLES2Decoder(),
group_(group),
logger_(&debug_marker_manager_),
- state_(group_->feature_info(), &logger_),
+ state_(group_->feature_info(), this, &logger_),
unpack_flip_y_(false),
unpack_premultiply_alpha_(false),
unpack_unpremultiply_alpha_(false),
@@ -2250,6 +2257,7 @@ GLES2DecoderImpl::GLES2DecoderImpl(ContextGroup* group)
frag_depth_explicitly_enabled_(false),
draw_buffers_explicitly_enabled_(false),
compile_shader_always_succeeds_(false),
+ lose_context_when_out_of_memory_(false),
service_logging_(CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableGPUServiceLoggingGPU)),
viewport_max_width_(0),
@@ -2323,6 +2331,10 @@ bool GLES2DecoderImpl::Initialize(
if (!attrib_parser.Parse(attribs))
return false;
+ // Save the loseContextWhenOutOfMemory context creation attribute.
+ lose_context_when_out_of_memory_ =
+ attrib_parser.lose_context_when_out_of_memory_;
+
// If the failIfMajorPerformanceCaveat context creation attribute was true
// and we are using a software renderer, fail.
if (attrib_parser.fail_if_major_perf_caveat_ &&
@@ -10659,6 +10671,13 @@ void GLES2DecoderImpl::OnTextureRefDetachedFromFramebuffer(
DoDidUseTexImageIfNeeded(texture, texture->target());
}
+void GLES2DecoderImpl::OnOutOfMemoryError() {
+ if (lose_context_when_out_of_memory_) {
+ group_->LoseContexts(GL_UNKNOWN_CONTEXT_RESET_ARB);
+ LoseContext(GL_GUILTY_CONTEXT_RESET_ARB);
+ }
+}
+
// Include the auto-generated part of this file. We split this because it means
// we can easily edit the non-auto generated parts right here in this file
// instead of having to edit some template or the code generator.
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc b/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc
index 6437648ac0..882a1249c2 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc
@@ -71,15 +71,14 @@ class GLES2DecoderTestWithExtensionsOnGLES2
GLES2DecoderTestWithExtensionsOnGLES2() {}
virtual void SetUp() {
- InitDecoder(GetParam(), // extensions
- "opengl es 2.0", // gl version
- true, // has alpha
- true, // has depth
- false, // has stencil
- true, // request alpha
- true, // request depth
- false, // request stencil
- false); // bind generates resource
+ InitState init;
+ init.extensions = GetParam();
+ init.gl_version = "opengl es 2.0";
+ init.has_alpha = true;
+ init.has_depth = true;
+ init.request_alpha = true;
+ init.request_depth = true;
+ InitDecoder(init);
}
};
@@ -100,16 +99,15 @@ class GLES2DecoderGeometryInstancingTest : public GLES2DecoderWithShaderTest {
}
virtual void SetUp() {
- InitDecoder(
- "GL_ANGLE_instanced_arrays", // extensions
- "opengl es 2.0", // gl version
- true, // has alpha
- true, // has depth
- false, // has stencil
- true, // request alpha
- true, // request depth
- false, // request stencil
- true); // bind generates resource
+ InitState init;
+ init.extensions = "GL_ANGLE_instanced_arrays";
+ init.gl_version = "opengl es 2.0";
+ init.has_alpha = true;
+ init.has_depth = true;
+ init.request_alpha = true;
+ init.request_depth = true;
+ init.bind_generates_resource = true;
+ InitDecoder(init);
SetupDefaultProgram();
}
};
@@ -125,17 +123,10 @@ class GLES2DecoderRGBBackbufferTest : public GLES2DecoderWithShaderTest {
command_line.AppendSwitchASCII(
switches::kGpuDriverBugWorkarounds,
base::IntToString(gpu::CLEAR_ALPHA_IN_READPIXELS));
- InitDecoderWithCommandLine(
- "", // extensions
- "3.0", // gl version
- false, // has alpha
- false, // has depth
- false, // has stencil
- false, // request alpha
- false, // request depth
- false, // request stencil
- true, // bind generates resource
- &command_line);
+ InitState init;
+ init.gl_version = "3.0";
+ init.bind_generates_resource = true;
+ InitDecoderWithCommandLine(init, &command_line);
SetupDefaultProgram();
}
};
@@ -215,6 +206,7 @@ TEST_F(GLES2DecoderWithShaderTest, DrawArraysSimulatedAttrib0OverflowFails) {
cmd.Init(GL_TRIANGLES, 0, kLargeCount);
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
EXPECT_EQ(GL_OUT_OF_MEMORY, GetGLError());
+ EXPECT_FALSE(GetDecoder()->WasContextLost());
}
// Tests when the math overflows (0x7FFFFFFF + 1 = 0x8000000 verts)
@@ -228,6 +220,7 @@ TEST_F(GLES2DecoderWithShaderTest, DrawArraysSimulatedAttrib0PosToNegFails) {
cmd.Init(GL_TRIANGLES, 0, kLargeCount);
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
EXPECT_EQ(GL_OUT_OF_MEMORY, GetGLError());
+ EXPECT_FALSE(GetDecoder()->WasContextLost());
}
// Tests when the driver returns an error
@@ -243,6 +236,37 @@ TEST_F(GLES2DecoderWithShaderTest, DrawArraysSimulatedAttrib0OOMFails) {
cmd.Init(GL_TRIANGLES, 0, kFakeLargeCount);
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
EXPECT_EQ(GL_OUT_OF_MEMORY, GetGLError());
+ EXPECT_FALSE(GetDecoder()->WasContextLost());
+}
+
+// Test that we lose context.
+TEST_F(GLES2DecoderManualInitTest, LoseContextWhenOOM) {
+ InitState init;
+ init.gl_version = "3.0";
+ init.has_alpha = true;
+ init.has_depth = true;
+ init.request_alpha = true;
+ init.request_depth = true;
+ init.bind_generates_resource = true;
+ init.lose_context_when_out_of_memory = true;
+ InitDecoder(init);
+ SetupDefaultProgram();
+
+ const GLsizei kFakeLargeCount = 0x1234;
+ SetupTexture();
+ AddExpectationsForSimulatedAttrib0WithError(
+ kFakeLargeCount, 0, GL_OUT_OF_MEMORY);
+ EXPECT_CALL(*gl_, DrawArrays(_, _, _)).Times(0).RetiresOnSaturation();
+ // Other contexts in the group should be lost also.
+ EXPECT_CALL(*mock_decoder_, LoseContext(GL_UNKNOWN_CONTEXT_RESET_ARB))
+ .Times(1)
+ .RetiresOnSaturation();
+ DrawArrays cmd;
+ cmd.Init(GL_TRIANGLES, 0, kFakeLargeCount);
+ // This context should be lost.
+ EXPECT_EQ(error::kLostContext, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_OUT_OF_MEMORY, GetGLError());
+ EXPECT_TRUE(decoder_->WasContextLost());
}
TEST_F(GLES2DecoderWithShaderTest, DrawArraysBadTextureUsesBlack) {
@@ -328,17 +352,14 @@ TEST_F(GLES2DecoderManualInitTest, InitVertexAttributes) {
command_line.AppendSwitchASCII(
switches::kGpuDriverBugWorkarounds,
base::IntToString(gpu::INIT_VERTEX_ATTRIBUTES));
- InitDecoderWithCommandLine(
- "", // extensions
- "3.0", // gl version
- true, // has alpha
- true, // has depth
- false, // has stencil
- true, // request alpha
- true, // request depth
- false, // request stencil
- true, // bind generates resource
- &command_line);
+ InitState init;
+ init.gl_version = "3.0";
+ init.has_alpha = true;
+ init.has_depth = true;
+ init.request_alpha = true;
+ init.request_depth = true;
+ init.bind_generates_resource = true;
+ InitDecoderWithCommandLine(init, &command_line);
SetupDefaultProgram();
SetupTexture();
SetupVertexBuffer();
@@ -1928,17 +1949,10 @@ TEST_F(GLES2DecoderManualInitTest, SetTextureFiltersBeforeGenerateMipmap) {
command_line.AppendSwitchASCII(
switches::kGpuDriverBugWorkarounds,
base::IntToString(gpu::SET_TEXTURE_FILTER_BEFORE_GENERATING_MIPMAP));
- InitDecoderWithCommandLine(
- "", // extensions
- "3.0", // gl version
- false, // has alpha
- false, // has depth
- false, // has stencil
- false, // request alpha
- false, // request depth
- false, // request stencil
- true, // bind generates resource
- &command_line);
+ InitState init;
+ init.gl_version = "3.0";
+ init.bind_generates_resource = true;
+ InitDecoderWithCommandLine(init, &command_line);
EXPECT_CALL(*gl_, GenerateMipmapEXT(_))
.Times(0);
@@ -2604,16 +2618,13 @@ TEST_F(GLES2DecoderTest, ReadPixelsInvalidArgs) {
}
TEST_F(GLES2DecoderManualInitTest, ReadPixelsAsyncError) {
- InitDecoder(
- "GL_ARB_sync", // extensions
- "opengl es 3.0", // gl version
- true, // has alpha
- false, // has depth
- false, // has stencil
- true, // request alpha
- false, // request depth
- false, // request stencil
- true); // bind generates resource
+ InitState init;
+ init.extensions = "GL_ARB_sync";
+ init.gl_version = "opengl es 3.0";
+ init.has_alpha = true;
+ init.request_alpha = true;
+ init.bind_generates_resource = true;
+ InitDecoder(init);
typedef ReadPixels::Result Result;
Result* result = GetSharedMemoryAs<Result*>();
@@ -3892,16 +3903,12 @@ TEST_F(GLES2DecoderRGBBackbufferTest, RGBBackbufferColorMaskFBO) {
}
TEST_F(GLES2DecoderManualInitTest, ActualAlphaMatchesRequestedAlpha) {
- InitDecoder(
- "", // extensions
- "3.0", // gl version
- true, // has alpha
- false, // has depth
- false, // has stencil
- true, // request alpha
- false, // request depth
- false, // request stencil
- true); // bind generates resource
+ InitState init;
+ init.gl_version = "3.0";
+ init.has_alpha = true;
+ init.request_alpha = true;
+ init.bind_generates_resource = true;
+ InitDecoder(init);
EXPECT_CALL(*gl_, GetError())
.WillOnce(Return(GL_NO_ERROR))
@@ -3924,16 +3931,11 @@ TEST_F(GLES2DecoderManualInitTest, ActualAlphaMatchesRequestedAlpha) {
}
TEST_F(GLES2DecoderManualInitTest, ActualAlphaDoesNotMatchRequestedAlpha) {
- InitDecoder(
- "", // extensions
- "3.0", // gl version
- true, // has alpha
- false, // has depth
- false, // has stencil
- false, // request alpha
- false, // request depth
- false, // request stencil
- true); // bind generates resource
+ InitState init;
+ init.gl_version = "3.0";
+ init.has_alpha = true;
+ init.bind_generates_resource = true;
+ InitDecoder(init);
EXPECT_CALL(*gl_, GetError())
.WillOnce(Return(GL_NO_ERROR))
@@ -3956,16 +3958,12 @@ TEST_F(GLES2DecoderManualInitTest, ActualAlphaDoesNotMatchRequestedAlpha) {
}
TEST_F(GLES2DecoderManualInitTest, ActualDepthMatchesRequestedDepth) {
- InitDecoder(
- "", // extensions
- "3.0", // gl version
- false, // has alpha
- true, // has depth
- false, // has stencil
- false, // request alpha
- true, // request depth
- false, // request stencil
- true); // bind generates resource
+ InitState init;
+ init.gl_version = "3.0";
+ init.has_depth = true;
+ init.request_depth = true;
+ init.bind_generates_resource = true;
+ InitDecoder(init);
EXPECT_CALL(*gl_, GetError())
.WillOnce(Return(GL_NO_ERROR))
@@ -3988,16 +3986,11 @@ TEST_F(GLES2DecoderManualInitTest, ActualDepthMatchesRequestedDepth) {
}
TEST_F(GLES2DecoderManualInitTest, ActualDepthDoesNotMatchRequestedDepth) {
- InitDecoder(
- "", // extensions
- "3.0", // gl version
- false, // has alpha
- true, // has depth
- false, // has stencil
- false, // request alpha
- false, // request depth
- false, // request stencil
- true); // bind generates resource
+ InitState init;
+ init.gl_version = "3.0";
+ init.has_depth = true;
+ init.bind_generates_resource = true;
+ InitDecoder(init);
EXPECT_CALL(*gl_, GetError())
.WillOnce(Return(GL_NO_ERROR))
@@ -4020,16 +4013,12 @@ TEST_F(GLES2DecoderManualInitTest, ActualDepthDoesNotMatchRequestedDepth) {
}
TEST_F(GLES2DecoderManualInitTest, ActualStencilMatchesRequestedStencil) {
- InitDecoder(
- "", // extensions
- "3.0", // gl version
- false, // has alpha
- false, // has depth
- true, // has stencil
- false, // request alpha
- false, // request depth
- true, // request stencil
- true); // bind generates resource
+ InitState init;
+ init.gl_version = "3.0";
+ init.has_stencil = true;
+ init.request_stencil = true;
+ init.bind_generates_resource = true;
+ InitDecoder(init);
EXPECT_CALL(*gl_, GetError())
.WillOnce(Return(GL_NO_ERROR))
@@ -4052,16 +4041,11 @@ TEST_F(GLES2DecoderManualInitTest, ActualStencilMatchesRequestedStencil) {
}
TEST_F(GLES2DecoderManualInitTest, ActualStencilDoesNotMatchRequestedStencil) {
- InitDecoder(
- "", // extensions
- "3.0", // gl version
- false, // has alpha
- false, // has depth
- true, // has stencil
- false, // request alpha
- false, // request depth
- false, // request stencil
- true); // bind generates resource
+ InitState init;
+ init.gl_version = "3.0";
+ init.has_stencil = true;
+ init.bind_generates_resource = true;
+ InitDecoder(init);
EXPECT_CALL(*gl_, GetError())
.WillOnce(Return(GL_NO_ERROR))
@@ -4084,16 +4068,12 @@ TEST_F(GLES2DecoderManualInitTest, ActualStencilDoesNotMatchRequestedStencil) {
}
TEST_F(GLES2DecoderManualInitTest, DepthEnableWithDepth) {
- InitDecoder(
- "", // extensions
- "3.0", // gl version
- false, // has alpha
- true, // has depth
- false, // has stencil
- false, // request alpha
- true, // request depth
- false, // request stencil
- true); // bind generates resource
+ InitState init;
+ init.gl_version = "3.0";
+ init.has_depth = true;
+ init.request_depth = true;
+ init.bind_generates_resource = true;
+ InitDecoder(init);
Enable cmd;
cmd.Init(GL_DEPTH_TEST);
@@ -4147,16 +4127,11 @@ TEST_F(GLES2DecoderManualInitTest, DepthEnableWithDepth) {
}
TEST_F(GLES2DecoderManualInitTest, DepthEnableWithoutRequestedDepth) {
- InitDecoder(
- "", // extensions
- "3.0", // gl version
- false, // has alpha
- true, // has depth
- false, // has stencil
- false, // request alpha
- false, // request depth
- false, // request stencil
- true); // bind generates resource
+ InitState init;
+ init.gl_version = "3.0";
+ init.has_depth = true;
+ init.bind_generates_resource = true;
+ InitDecoder(init);
Enable cmd;
cmd.Init(GL_DEPTH_TEST);
@@ -4209,16 +4184,12 @@ TEST_F(GLES2DecoderManualInitTest, DepthEnableWithoutRequestedDepth) {
}
TEST_F(GLES2DecoderManualInitTest, StencilEnableWithStencil) {
- InitDecoder(
- "", // extensions
- "3.0", // gl version
- false, // has alpha
- false, // has depth
- true, // has stencil
- false, // request alpha
- false, // request depth
- true, // request stencil
- true); // bind generates resource
+ InitState init;
+ init.gl_version = "3.0";
+ init.has_stencil = true;
+ init.request_stencil = true;
+ init.bind_generates_resource = true;
+ InitDecoder(init);
Enable cmd;
cmd.Init(GL_STENCIL_TEST);
@@ -4271,16 +4242,11 @@ TEST_F(GLES2DecoderManualInitTest, StencilEnableWithStencil) {
}
TEST_F(GLES2DecoderManualInitTest, StencilEnableWithoutRequestedStencil) {
- InitDecoder(
- "", // extensions
- "3.0", // gl version
- false, // has alpha
- false, // has depth
- true, // has stencil
- false, // request alpha
- false, // request depth
- false, // request stencil
- true); // bind generates resource
+ InitState init;
+ init.gl_version = "3.0";
+ init.has_stencil = true;
+ init.bind_generates_resource = true;
+ InitDecoder(init);
Enable cmd;
cmd.Init(GL_STENCIL_TEST);
@@ -4333,16 +4299,15 @@ TEST_F(GLES2DecoderManualInitTest, StencilEnableWithoutRequestedStencil) {
}
TEST_F(GLES2DecoderManualInitTest, PackedDepthStencilReportsCorrectValues) {
- InitDecoder(
- "GL_OES_packed_depth_stencil", // extensions
- "opengl es 2.0", // gl version
- false, // has alpha
- true, // has depth
- true, // has stencil
- false, // request alpha
- true, // request depth
- true, // request stencil
- true); // bind generates resource
+ InitState init;
+ init.extensions = "GL_OES_packed_depth_stencil";
+ init.gl_version = "opengl es 2.0";
+ init.has_depth = true;
+ init.has_stencil = true;
+ init.request_depth = true;
+ init.request_stencil = true;
+ init.bind_generates_resource = true;
+ InitDecoder(init);
EXPECT_CALL(*gl_, GetError())
.WillOnce(Return(GL_NO_ERROR))
@@ -4378,16 +4343,14 @@ TEST_F(GLES2DecoderManualInitTest, PackedDepthStencilReportsCorrectValues) {
}
TEST_F(GLES2DecoderManualInitTest, PackedDepthStencilNoRequestedStencil) {
- InitDecoder(
- "GL_OES_packed_depth_stencil", // extensions
- "opengl es 2.0", // gl version
- false, // has alpha
- true, // has depth
- true, // has stencil
- false, // request alpha
- true, // request depth
- false, // request stencil
- true); // bind generates resource
+ InitState init;
+ init.extensions = "GL_OES_packed_depth_stencil";
+ init.gl_version = "opengl es 2.0";
+ init.has_depth = true;
+ init.has_stencil = true;
+ init.request_depth = true;
+ init.bind_generates_resource = true;
+ InitDecoder(init);
EXPECT_CALL(*gl_, GetError())
.WillOnce(Return(GL_NO_ERROR))
@@ -4423,16 +4386,11 @@ TEST_F(GLES2DecoderManualInitTest, PackedDepthStencilNoRequestedStencil) {
}
TEST_F(GLES2DecoderManualInitTest, PackedDepthStencilRenderbufferDepth) {
- InitDecoder(
- "GL_OES_packed_depth_stencil", // extensions
- "opengl es 2.0", // gl version
- false, // has alpha
- false, // has depth
- false, // has stencil
- false, // request alpha
- false, // request depth
- false, // request stencil
- true); // bind generates resource
+ InitState init;
+ init.extensions = "GL_OES_packed_depth_stencil";
+ init.gl_version = "opengl es 2.0";
+ init.bind_generates_resource = true;
+ InitDecoder(init);
DoBindRenderbuffer(GL_RENDERBUFFER, client_renderbuffer_id_,
kServiceRenderbufferId);
DoBindFramebuffer(GL_FRAMEBUFFER, client_framebuffer_id_,
@@ -4495,16 +4453,11 @@ TEST_F(GLES2DecoderManualInitTest, PackedDepthStencilRenderbufferDepth) {
}
TEST_F(GLES2DecoderManualInitTest, PackedDepthStencilRenderbufferStencil) {
- InitDecoder(
- "GL_OES_packed_depth_stencil", // extensions
- "opengl es 2.0", // gl version
- false, // has alpha
- false, // has depth
- false, // has stencil
- false, // request alpha
- false, // request depth
- false, // request stencil
- true); // bind generates resource
+ InitState init;
+ init.extensions = "GL_OES_packed_depth_stencil";
+ init.gl_version = "opengl es 2.0";
+ init.bind_generates_resource = true;
+ InitDecoder(init);
DoBindRenderbuffer(GL_RENDERBUFFER, client_renderbuffer_id_,
kServiceRenderbufferId);
DoBindFramebuffer(GL_FRAMEBUFFER, client_framebuffer_id_,
@@ -4899,16 +4852,11 @@ TEST_F(GLES2DecoderTest, RenderbufferStorageBadArgs) {
TEST_F(GLES2DecoderManualInitTest,
RenderbufferStorageMultisampleCHROMIUMGLError) {
- InitDecoder(
- "GL_EXT_framebuffer_multisample", // extensions
- "2.1", // gl version
- false, // has alpha
- false, // has depth
- false, // has stencil
- false, // request alpha
- false, // request depth
- false, // request stencil
- true); // bind generates resource
+ InitState init;
+ init.extensions = "GL_EXT_framebuffer_multisample";
+ init.gl_version = "2.1";
+ init.bind_generates_resource = true;
+ InitDecoder(init);
DoBindRenderbuffer(GL_RENDERBUFFER, client_renderbuffer_id_,
kServiceRenderbufferId);
EXPECT_CALL(*gl_, GetError())
@@ -4927,16 +4875,11 @@ TEST_F(GLES2DecoderManualInitTest,
TEST_F(GLES2DecoderManualInitTest,
RenderbufferStorageMultisampleCHROMIUMBadArgs) {
- InitDecoder(
- "GL_EXT_framebuffer_multisample", // extensions
- "2.1", // gl version
- false, // has alpha
- false, // has depth
- false, // has stencil
- false, // request alpha
- false, // request depth
- false, // request stencil
- true); // bind generates resource
+ InitState init;
+ init.extensions = "GL_EXT_framebuffer_multisample";
+ init.gl_version = "2.1";
+ init.bind_generates_resource = true;
+ InitDecoder(init);
DoBindRenderbuffer(GL_RENDERBUFFER, client_renderbuffer_id_,
kServiceRenderbufferId);
EXPECT_CALL(*gl_, RenderbufferStorageMultisampleEXT(_, _, _, _, _))
@@ -4958,16 +4901,10 @@ TEST_F(GLES2DecoderManualInitTest,
}
TEST_F(GLES2DecoderManualInitTest, RenderbufferStorageMultisampleCHROMIUM) {
- InitDecoder(
- "GL_EXT_framebuffer_multisample", // extensions
- "2.1", // gl version
- false, // has alpha
- false, // has depth
- false, // has stencil
- false, // request alpha
- false, // request depth
- false, // request stencil
- false); // bind generates resource
+ InitState init;
+ init.extensions = "GL_EXT_framebuffer_multisample";
+ init.gl_version = "2.1";
+ InitDecoder(init);
DoBindRenderbuffer(GL_RENDERBUFFER, client_renderbuffer_id_,
kServiceRenderbufferId);
InSequence sequence;
@@ -4995,16 +4932,11 @@ TEST_F(GLES2DecoderManualInitTest, RenderbufferStorageMultisampleCHROMIUM) {
TEST_F(GLES2DecoderManualInitTest,
RenderbufferStorageMultisampleEXTNotSupported) {
- InitDecoder(
- "GL_EXT_framebuffer_multisample", // extensions
- "2.1", // gl version
- false, // has alpha
- false, // has depth
- false, // has stencil
- false, // request alpha
- false, // request depth
- false, // request stencil
- false); // bind generates resource
+ InitState init;
+ init.extensions = "GL_EXT_framebuffer_multisample";
+ init.gl_version = "2.1";
+ init.bind_generates_resource = true;
+ InitDecoder(init);
DoBindRenderbuffer(GL_RENDERBUFFER, client_renderbuffer_id_,
kServiceRenderbufferId);
InSequence sequence;
@@ -5114,16 +5046,11 @@ static bool ValueInArray(GLint value, GLint* array, GLint count) {
}
TEST_F(GLES2DecoderManualInitTest, GetCompressedTextureFormats) {
- InitDecoder(
- "GL_EXT_texture_compression_s3tc", // extensions
- "3.0", // gl version
- false, // has alpha
- false, // has depth
- false, // has stencil
- false, // request alpha
- false, // request depth
- false, // request stencil
- true); // bind generates resource
+ InitState init;
+ init.extensions = "GL_EXT_texture_compression_s3tc";
+ init.gl_version = "3.0";
+ init.bind_generates_resource = true;
+ InitDecoder(init);
EXPECT_CALL(*gl_, GetError())
.WillOnce(Return(GL_NO_ERROR))
@@ -5172,16 +5099,10 @@ TEST_F(GLES2DecoderManualInitTest, GetCompressedTextureFormats) {
}
TEST_F(GLES2DecoderManualInitTest, GetNoCompressedTextureFormats) {
- InitDecoder(
- "", // extensions
- "3.0", // gl version
- false, // has alpha
- false, // has depth
- false, // has stencil
- false, // request alpha
- false, // request depth
- false, // request stencil
- true); // bind generates resource
+ InitState init;
+ init.gl_version = "3.0";
+ init.bind_generates_resource = true;
+ InitDecoder(init);
EXPECT_CALL(*gl_, GetError())
.WillOnce(Return(GL_NO_ERROR))
@@ -5217,16 +5138,11 @@ TEST_F(GLES2DecoderManualInitTest, GetNoCompressedTextureFormats) {
}
TEST_F(GLES2DecoderManualInitTest, CompressedTexImage2DBucketBadBucket) {
- InitDecoder(
- "GL_EXT_texture_compression_s3tc", // extensions
- "3.0", // gl version
- false, // has alpha
- false, // has depth
- false, // has stencil
- false, // request alpha
- false, // request depth
- false, // request stencil
- true); // bind generates resource
+ InitState init;
+ init.extensions = "GL_EXT_texture_compression_s3tc";
+ init.gl_version = "3.0";
+ init.bind_generates_resource = true;
+ InitDecoder(init);
const uint32 kBadBucketId = 123;
DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
@@ -5252,16 +5168,11 @@ struct S3TCTestData {
} // anonymous namespace.
TEST_F(GLES2DecoderManualInitTest, CompressedTexImage2DS3TC) {
- InitDecoder(
- "GL_EXT_texture_compression_s3tc", // extensions
- "3.0", // gl version
- false, // has alpha
- false, // has depth
- false, // has stencil
- false, // request alpha
- false, // request depth
- false, // request stencil
- true); // bind generates resource
+ InitState init;
+ init.extensions = "GL_EXT_texture_compression_s3tc";
+ init.gl_version = "3.0";
+ init.bind_generates_resource = true;
+ InitDecoder(init);
const uint32 kBucketId = 123;
CommonDecoder::Bucket* bucket = decoder_->CreateBucket(kBucketId);
ASSERT_TRUE(bucket != NULL);
@@ -5407,16 +5318,11 @@ TEST_F(GLES2DecoderManualInitTest, CompressedTexImage2DS3TC) {
}
TEST_F(GLES2DecoderManualInitTest, CompressedTexImage2DETC1) {
- InitDecoder(
- "GL_OES_compressed_ETC1_RGB8_texture", // extensions
- "opengl es 2.0", // gl version
- false, // has alpha
- false, // has depth
- false, // has stencil
- false, // request alpha
- false, // request depth
- false, // request stencil
- true); // bind generates resource
+ InitState init;
+ init.extensions = "GL_OES_compressed_ETC1_RGB8_texture";
+ init.gl_version = "opengl es 2.0";
+ init.bind_generates_resource = true;
+ InitDecoder(init);
const uint32 kBucketId = 123;
CommonDecoder::Bucket* bucket = decoder_->CreateBucket(kBucketId);
ASSERT_TRUE(bucket != NULL);
@@ -5480,16 +5386,11 @@ TEST_F(GLES2DecoderManualInitTest, CompressedTexImage2DETC1) {
}
TEST_F(GLES2DecoderManualInitTest, GetCompressedTextureFormatsETC1) {
- InitDecoder(
- "GL_OES_compressed_ETC1_RGB8_texture", // extensions
- "opengl es 2.0", // gl version
- false, // has alpha
- false, // has depth
- false, // has stencil
- false, // request alpha
- false, // request depth
- false, // request stencil
- true); // bind generates resource
+ InitState init;
+ init.extensions = "GL_OES_compressed_ETC1_RGB8_texture";
+ init.gl_version = "opengl es 2.0";
+ init.bind_generates_resource = true;
+ InitDecoder(init);
EXPECT_CALL(*gl_, GetError())
.WillOnce(Return(GL_NO_ERROR))
@@ -5556,16 +5457,11 @@ TEST_F(GLES2DecoderWithShaderTest, GetProgramInfoCHROMIUMInvalidArgs) {
}
TEST_F(GLES2DecoderManualInitTest, EGLImageExternalBindTexture) {
- InitDecoder(
- "GL_OES_EGL_image_external", // extensions
- "opengl es 2.0", // gl version
- false, // has alpha
- false, // has depth
- false, // has stencil
- false, // request alpha
- false, // request depth
- false, // request stencil
- true); // bind generates resource
+ InitState init;
+ init.extensions = "GL_OES_EGL_image_external";
+ init.gl_version = "opengl es 2.0";
+ init.bind_generates_resource = true;
+ InitDecoder(init);
EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_EXTERNAL_OES, kNewServiceId));
EXPECT_CALL(*gl_, GenTextures(1, _))
.WillOnce(SetArgumentPointee<1>(kNewServiceId));
@@ -5579,16 +5475,11 @@ TEST_F(GLES2DecoderManualInitTest, EGLImageExternalBindTexture) {
}
TEST_F(GLES2DecoderManualInitTest, EGLImageExternalGetBinding) {
- InitDecoder(
- "GL_OES_EGL_image_external", // extensions
- "opengl es 2.0", // gl version
- false, // has alpha
- false, // has depth
- false, // has stencil
- false, // request alpha
- false, // request depth
- false, // request stencil
- true); // bind generates resource
+ InitState init;
+ init.extensions = "GL_OES_EGL_image_external";
+ init.gl_version = "opengl es 2.0";
+ init.bind_generates_resource = true;
+ InitDecoder(init);
DoBindTexture(GL_TEXTURE_EXTERNAL_OES, client_texture_id_, kServiceTextureId);
EXPECT_CALL(*gl_, GetError())
@@ -5613,16 +5504,11 @@ TEST_F(GLES2DecoderManualInitTest, EGLImageExternalGetBinding) {
}
TEST_F(GLES2DecoderManualInitTest, EGLImageExternalTextureDefaults) {
- InitDecoder(
- "GL_OES_EGL_image_external", // extensions
- "opengl es 2.0", // gl version
- false, // has alpha
- false, // has depth
- false, // has stencil
- false, // request alpha
- false, // request depth
- false, // request stencil
- true); // bind generates resource
+ InitState init;
+ init.extensions = "GL_OES_EGL_image_external";
+ init.gl_version = "opengl es 2.0";
+ init.bind_generates_resource = true;
+ InitDecoder(init);
DoBindTexture(GL_TEXTURE_EXTERNAL_OES, client_texture_id_, kServiceTextureId);
TextureRef* texture_ref = GetTexture(client_texture_id_);
@@ -5635,17 +5521,11 @@ TEST_F(GLES2DecoderManualInitTest, EGLImageExternalTextureDefaults) {
}
TEST_F(GLES2DecoderManualInitTest, EGLImageExternalTextureParam) {
- InitDecoder(
- "GL_OES_EGL_image_external", // extensions
- "opengl es 2.0", // gl version
- false, // has alpha
- false, // has depth
- false, // has stencil
- false, // request alpha
- false, // request depth
- false, // request stencil
- true); // bind generates resource
-
+ InitState init;
+ init.extensions = "GL_OES_EGL_image_external";
+ init.gl_version = "opengl es 2.0";
+ init.bind_generates_resource = true;
+ InitDecoder(init);
DoBindTexture(GL_TEXTURE_EXTERNAL_OES, client_texture_id_, kServiceTextureId);
EXPECT_CALL(*gl_, TexParameteri(GL_TEXTURE_EXTERNAL_OES,
@@ -5695,17 +5575,11 @@ TEST_F(GLES2DecoderManualInitTest, EGLImageExternalTextureParam) {
}
TEST_F(GLES2DecoderManualInitTest, EGLImageExternalTextureParamInvalid) {
- InitDecoder(
- "GL_OES_EGL_image_external", // extensions
- "opengl es 2.0", // gl version
- false, // has alpha
- false, // has depth
- false, // has stencil
- false, // request alpha
- false, // request depth
- false, // request stencil
- true); // bind generates resource
-
+ InitState init;
+ init.extensions = "GL_OES_EGL_image_external";
+ init.gl_version = "opengl es 2.0";
+ init.bind_generates_resource = true;
+ InitDecoder(init);
DoBindTexture(GL_TEXTURE_EXTERNAL_OES, client_texture_id_, kServiceTextureId);
TexParameteri cmd;
@@ -5737,16 +5611,11 @@ TEST_F(GLES2DecoderManualInitTest, EGLImageExternalTextureParamInvalid) {
}
TEST_F(GLES2DecoderManualInitTest, EGLImageExternalTexImage2DError) {
- InitDecoder(
- "GL_OES_EGL_image_external", // extensions
- "opengl es 2.0", // gl version
- false, // has alpha
- false, // has depth
- false, // has stencil
- false, // request alpha
- false, // request depth
- false, // request stencil
- true); // bind generates resource
+ InitState init;
+ init.extensions = "GL_OES_EGL_image_external";
+ init.gl_version = "opengl es 2.0";
+ init.bind_generates_resource = true;
+ InitDecoder(init);
GLenum target = GL_TEXTURE_EXTERNAL_OES;
GLint level = 0;
@@ -5768,16 +5637,9 @@ TEST_F(GLES2DecoderManualInitTest, EGLImageExternalTexImage2DError) {
}
TEST_F(GLES2DecoderManualInitTest, BindGeneratesResourceFalse) {
- InitDecoder(
- "", // extensions
- "3.0", // gl version
- false, // has alpha
- false, // has depth
- false, // has stencil
- false, // request alpha
- false, // request depth
- false, // request stencil
- false); // bind generates resource
+ InitState init;
+ init.gl_version = "3.0";
+ InitDecoder(init);
BindTexture cmd1;
cmd1.Init(GL_TEXTURE_2D, kInvalidClientId);
@@ -5801,16 +5663,11 @@ TEST_F(GLES2DecoderManualInitTest, BindGeneratesResourceFalse) {
}
TEST_F(GLES2DecoderManualInitTest, ARBTextureRectangleBindTexture) {
- InitDecoder(
- "GL_ARB_texture_rectangle", // extensions
- "3.0", // gl version
- false, // has alpha
- false, // has depth
- false, // has stencil
- false, // request alpha
- false, // request depth
- false, // request stencil
- true); // bind generates resource
+ InitState init;
+ init.extensions = "GL_ARB_texture_rectangle";
+ init.gl_version = "3.0";
+ init.bind_generates_resource = true;
+ InitDecoder(init);
EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_RECTANGLE_ARB, kNewServiceId));
EXPECT_CALL(*gl_, GenTextures(1, _))
.WillOnce(SetArgumentPointee<1>(kNewServiceId));
@@ -5824,16 +5681,11 @@ TEST_F(GLES2DecoderManualInitTest, ARBTextureRectangleBindTexture) {
}
TEST_F(GLES2DecoderManualInitTest, ARBTextureRectangleGetBinding) {
- InitDecoder(
- "GL_ARB_texture_rectangle", // extensions
- "3.0", // gl version
- false, // has alpha
- false, // has depth
- false, // has stencil
- false, // request alpha
- false, // request depth
- false, // request stencil
- true); // bind generates resource
+ InitState init;
+ init.extensions = "GL_ARB_texture_rectangle";
+ init.gl_version = "3.0";
+ init.bind_generates_resource = true;
+ InitDecoder(init);
DoBindTexture(
GL_TEXTURE_RECTANGLE_ARB, client_texture_id_, kServiceTextureId);
@@ -5859,16 +5711,11 @@ TEST_F(GLES2DecoderManualInitTest, ARBTextureRectangleGetBinding) {
}
TEST_F(GLES2DecoderManualInitTest, ARBTextureRectangleTextureDefaults) {
- InitDecoder(
- "GL_ARB_texture_rectangle", // extensions
- "3.0", // gl version
- false, // has alpha
- false, // has depth
- false, // has stencil
- false, // request alpha
- false, // request depth
- false, // request stencil
- true); // bind generates resource
+ InitState init;
+ init.extensions = "GL_ARB_texture_rectangle";
+ init.gl_version = "3.0";
+ init.bind_generates_resource = true;
+ InitDecoder(init);
DoBindTexture(
GL_TEXTURE_RECTANGLE_ARB, client_texture_id_, kServiceTextureId);
@@ -5881,16 +5728,11 @@ TEST_F(GLES2DecoderManualInitTest, ARBTextureRectangleTextureDefaults) {
}
TEST_F(GLES2DecoderManualInitTest, ARBTextureRectangleTextureParam) {
- InitDecoder(
- "GL_ARB_texture_rectangle", // extensions
- "3.0", // gl version
- false, // has alpha
- false, // has depth
- false, // has stencil
- false, // request alpha
- false, // request depth
- false, // request stencil
- true); // bind generates resource
+ InitState init;
+ init.extensions = "GL_ARB_texture_rectangle";
+ init.gl_version = "3.0";
+ init.bind_generates_resource = true;
+ InitDecoder(init);
DoBindTexture(
GL_TEXTURE_RECTANGLE_ARB, client_texture_id_, kServiceTextureId);
@@ -5941,16 +5783,11 @@ TEST_F(GLES2DecoderManualInitTest, ARBTextureRectangleTextureParam) {
}
TEST_F(GLES2DecoderManualInitTest, ARBTextureRectangleTextureParamInvalid) {
- InitDecoder(
- "GL_ARB_texture_rectangle", // extensions
- "3.0", // gl version
- false, // has alpha
- false, // has depth
- false, // has stencil
- false, // request alpha
- false, // request depth
- false, // request stencil
- true); // bind generates resource
+ InitState init;
+ init.extensions = "GL_ARB_texture_rectangle";
+ init.gl_version = "3.0";
+ init.bind_generates_resource = true;
+ InitDecoder(init);
DoBindTexture(
GL_TEXTURE_RECTANGLE_ARB, client_texture_id_, kServiceTextureId);
@@ -5983,16 +5820,11 @@ TEST_F(GLES2DecoderManualInitTest, ARBTextureRectangleTextureParamInvalid) {
}
TEST_F(GLES2DecoderManualInitTest, ARBTextureRectangleTexImage2DError) {
- InitDecoder(
- "GL_ARB_texture_rectangle", // extensions
- "3.0", // gl version
- false, // has alpha
- false, // has depth
- false, // has stencil
- false, // request alpha
- false, // request depth
- false, // request stencil
- true); // bind generates resource
+ InitState init;
+ init.extensions = "GL_ARB_texture_rectangle";
+ init.gl_version = "3.0";
+ init.bind_generates_resource = true;
+ InitDecoder(init);
GLenum target = GL_TEXTURE_RECTANGLE_ARB;
GLint level = 0;
@@ -6087,17 +5919,10 @@ TEST_F(
command_line.AppendSwitchASCII(
switches::kGpuDriverBugWorkarounds,
base::IntToString(gpu::TEXSUBIMAGE2D_FASTER_THAN_TEXIMAGE2D));
- InitDecoderWithCommandLine(
- "", // extensions
- "3.0", // gl version
- false, // has alpha
- false, // has depth
- false, // has stencil
- false, // request alpha
- false, // request depth
- false, // request stencil
- true, // bind generates resource
- &command_line);
+ InitState init;
+ init.gl_version = "3.0";
+ init.bind_generates_resource = true;
+ InitDecoderWithCommandLine(init, &command_line);
DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
DoTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 2, 2, 0, GL_RGBA, GL_UNSIGNED_BYTE,
0, 0);
@@ -6379,16 +6204,11 @@ TEST_F(GLES2DecoderTest, CopyTexSubImage2DClearsUnclearedTexture) {
}
TEST_F(GLES2DecoderManualInitTest, CompressedImage2DMarksTextureAsCleared) {
- InitDecoder(
- "GL_EXT_texture_compression_s3tc", // extensions
- "3.0", // gl version
- false, // has alpha
- false, // has depth
- false, // has stencil
- false, // request alpha
- false, // request depth
- false, // request stencil
- true); // bind generates resource
+ InitState init;
+ init.extensions = "GL_EXT_texture_compression_s3tc";
+ init.gl_version = "3.0";
+ init.bind_generates_resource = true;
+ InitDecoder(init);
DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
EXPECT_CALL(*gl_, GetError())
@@ -6519,16 +6339,11 @@ TEST_F(GLES2DecoderWithShaderTest, UnClearedAttachmentsGetClearedOnReadPixels) {
TEST_F(GLES2DecoderManualInitTest,
UnClearedAttachmentsGetClearedOnReadPixelsAndDrawBufferGetsRestored) {
- InitDecoder(
- "GL_EXT_framebuffer_multisample", // extensions
- "2.1", // gl version
- false, // has alpha
- false, // has depth
- false, // has stencil
- false, // request alpha
- false, // request depth
- false, // request stencil
- true); // bind generates resource
+ InitState init;
+ init.extensions = "GL_EXT_framebuffer_multisample";
+ init.gl_version = "2.1";
+ init.bind_generates_resource = true;
+ InitDecoder(init);
const GLuint kFBOClientTextureId = 4100;
const GLuint kFBOServiceTextureId = 4101;
@@ -6807,6 +6622,11 @@ void GLES2DecoderWithShaderTest::CheckRenderbufferChangesMarkFBOAsNotComplete(
} else {
EXPECT_TRUE(framebuffer_manager->IsComplete(framebuffer));
}
+ // Cleanup
+ DoDeleteFramebuffer(
+ client_framebuffer_id_, kServiceFramebufferId,
+ bound_fbo, GL_FRAMEBUFFER, 0,
+ bound_fbo, GL_FRAMEBUFFER, 0);
}
TEST_F(GLES2DecoderWithShaderTest,
@@ -6896,6 +6716,11 @@ void GLES2DecoderWithShaderTest::CheckTextureChangesMarkFBOAsNotComplete(
} else {
EXPECT_TRUE(framebuffer_manager->IsComplete(framebuffer));
}
+ // Cleanup
+ DoDeleteFramebuffer(
+ client_framebuffer_id_, kServiceFramebufferId,
+ bound_fbo, GL_FRAMEBUFFER, 0,
+ bound_fbo, GL_FRAMEBUFFER, 0);
}
TEST_F(GLES2DecoderWithShaderTest, TextureChangesMarkFBOAsNotCompleteBoundFBO) {
@@ -6974,16 +6799,13 @@ TEST_F(GLES2DecoderTest, BeginQueryEXTDisabled) {
}
TEST_F(GLES2DecoderManualInitTest, BeginEndQueryEXT) {
- InitDecoder(
- "GL_EXT_occlusion_query_boolean", // extensions
- "opengl es 2.0", // gl version
- true, // has alpha
- false, // has depth
- false, // has stencil
- true, // request alpha
- false, // request depth
- false, // request stencil
- true); // bind generates resource
+ InitState init;
+ init.extensions = "GL_EXT_occlusion_query_boolean";
+ init.gl_version = "opengl es 2.0";
+ init.has_alpha = true;
+ init.request_alpha = true;
+ init.bind_generates_resource = true;
+ InitDecoder(init);
// Test end fails if no begin.
EndQueryEXT end_cmd;
@@ -7066,16 +6888,13 @@ static void CheckBeginEndQueryBadMemoryFails(
uint32 shm_offset) {
// We need to reset the decoder on each iteration, because we lose the
// context every time.
- test->InitDecoder(
- "GL_EXT_occlusion_query_boolean", // extensions
- "opengl es 2.0", // gl version
- true, // has alpha
- false, // has depth
- false, // has stencil
- true, // request alpha
- false, // request depth
- false, // request stencil
- true); // bind generates resource
+ GLES2DecoderTestBase::InitState init;
+ init.extensions = "GL_EXT_occlusion_query_boolean";
+ init.gl_version = "opengl es 2.0";
+ init.has_alpha = true;
+ init.request_alpha = true;
+ init.bind_generates_resource = true;
+ test->InitDecoder(init);
::testing::StrictMock< ::gfx::MockGLInterface>* gl = test->GetGLMock();
BeginQueryEXT begin_cmd;
@@ -7341,16 +7160,15 @@ TEST_F(GLES2DecoderTest, IsEnabledReturnsCachedValue) {
}
TEST_F(GLES2DecoderManualInitTest, DepthTextureBadArgs) {
- InitDecoder(
- "GL_ANGLE_depth_texture", // extensions
- "opengl es 2.0", // gl version
- false, // has alpha
- true, // has depth
- true, // has stencil
- false, // request alpha
- true, // request depth
- true, // request stencil
- true); // bind generates resource
+ InitState init;
+ init.extensions = "GL_ANGLE_depth_texture";
+ init.gl_version = "opengl es 2.0";
+ init.has_depth = true;
+ init.has_stencil = true;
+ init.request_depth = true;
+ init.request_stencil = true;
+ init.bind_generates_resource = true;
+ InitDecoder(init);
DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
// Check trying to upload data fails.
@@ -7394,16 +7212,15 @@ TEST_F(GLES2DecoderManualInitTest, DepthTextureBadArgs) {
}
TEST_F(GLES2DecoderManualInitTest, GenerateMipmapDepthTexture) {
- InitDecoder(
- "GL_ANGLE_depth_texture", // extensions
- "opengl es 2.0", // gl version
- false, // has alpha
- true, // has depth
- true, // has stencil
- false, // request alpha
- true, // request depth
- true, // request stencil
- true); // bind generates resource
+ InitState init;
+ init.extensions = "GL_ANGLE_depth_texture";
+ init.gl_version = "opengl es 2.0";
+ init.has_depth = true;
+ init.has_stencil = true;
+ init.request_depth = true;
+ init.request_stencil = true;
+ init.bind_generates_resource = true;
+ InitDecoder(init);
DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
DoTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT,
2, 2, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT,
@@ -7415,16 +7232,15 @@ TEST_F(GLES2DecoderManualInitTest, GenerateMipmapDepthTexture) {
}
TEST_F(GLES2DecoderManualInitTest, DrawClearsDepthTexture) {
- InitDecoder(
- "GL_ANGLE_depth_texture", // extensions
- "opengl es 2.0", // gl version
- true, // has alpha
- true, // has depth
- false, // has stencil
- true, // request alpha
- true, // request depth
- false, // request stencil
- true); // bind generates resource
+ InitState init;
+ init.extensions = "GL_ANGLE_depth_texture";
+ init.gl_version = "opengl es 2.0";
+ init.has_alpha = true;
+ init.has_depth = true;
+ init.request_alpha = true;
+ init.request_depth = true;
+ init.bind_generates_resource = true;
+ InitDecoder(init);
SetupDefaultProgram();
SetupAllNeededVertexBuffers();
@@ -7547,16 +7363,11 @@ class GLES2DecoderVertexArraysOESTest : public GLES2DecoderWithShaderTest {
bool vertex_array_deleted_manually_;
virtual void SetUp() {
- InitDecoder(
- "GL_OES_vertex_array_object", // extensions
- "opengl es 2.0", // gl version
- false, // has alpha
- false, // has depth
- false, // has stencil
- false, // request alpha
- false, // request depth
- false, // request stencil
- true); // bind generates resource
+ InitState init;
+ init.extensions = "GL_OES_vertex_array_object";
+ init.gl_version = "opengl es 2.0";
+ init.bind_generates_resource = true;
+ InitDecoder(init);
SetupDefaultProgram();
AddExpectationsForGenVertexArraysOES();
@@ -7698,16 +7509,10 @@ class GLES2DecoderEmulatedVertexArraysOESTest
GLES2DecoderEmulatedVertexArraysOESTest() { }
virtual void SetUp() {
- InitDecoder(
- "", // extensions
- "3.0", // gl version
- false, // has alpha
- false, // has depth
- false, // has stencil
- false, // request alpha
- false, // request depth
- false, // request stencil
- true); // bind generates resource
+ InitState init;
+ init.gl_version = "3.0";
+ init.bind_generates_resource = true;
+ InitDecoder(init);
SetupDefaultProgram();
AddExpectationsForGenVertexArraysOES();
@@ -8085,16 +7890,15 @@ TEST_F(GLES2DecoderWithShaderTest, UseTexImage) {
}
TEST_F(GLES2DecoderManualInitTest, DrawWithGLImageExternal) {
- InitDecoder(
- "GL_OES_EGL_image_external", // extensions
- "opengl es 2.0", // gl version
- true, // has alpha
- true, // has depth
- false, // has stencil
- true, // request alpha
- true, // request depth
- false, // request stencil
- true); // bind generates resource
+ InitState init;
+ init.extensions = "GL_OES_EGL_image_external";
+ init.gl_version = "opengl es 2.0";
+ init.has_alpha = true;
+ init.has_depth = true;
+ init.request_alpha = true;
+ init.request_depth = true;
+ init.bind_generates_resource = true;
+ InitDecoder(init);
TextureRef* texture_ref = GetTexture(client_texture_id_);
scoped_refptr<MockGLImage> image(new MockGLImage);
@@ -8160,16 +7964,11 @@ TEST_F(GLES2DecoderManualInitTest, DrawWithGLImageExternal) {
}
TEST_F(GLES2DecoderManualInitTest, GpuMemoryManagerCHROMIUM) {
- InitDecoder(
- "GL_ARB_texture_rectangle", // extensions
- "3.0", // gl version
- false, // has alpha
- false, // has depth
- false, // has stencil
- false, // request alpha
- false, // request depth
- false, // request stencil
- true); // bind generates resource
+ InitState init;
+ init.extensions = "GL_ARB_texture_rectangle";
+ init.gl_version = "3.0";
+ init.bind_generates_resource = true;
+ InitDecoder(init);
Texture* texture = GetTexture(client_texture_id_)->texture();
EXPECT_TRUE(texture != NULL);
@@ -8201,12 +8000,11 @@ TEST_F(GLES2DecoderManualInitTest, GpuMemoryManagerCHROMIUM) {
}
TEST_F(GLES2DecoderManualInitTest, AsyncPixelTransfers) {
- InitDecoder(
- "GL_CHROMIUM_async_pixel_transfers", // extensions
- "3.0", // gl version
- false, false, false, // has alpha/depth/stencil
- false, false, false, // request alpha/depth/stencil
- true); // bind generates resource
+ InitState init;
+ init.extensions = "GL_CHROMIUM_async_pixel_transfers";
+ init.gl_version = "3.0";
+ init.bind_generates_resource = true;
+ InitDecoder(init);
// Set up the texture.
DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
@@ -8439,12 +8237,11 @@ TEST_F(GLES2DecoderManualInitTest, AsyncPixelTransfers) {
}
TEST_F(GLES2DecoderManualInitTest, AsyncPixelTransferManager) {
- InitDecoder(
- "GL_CHROMIUM_async_pixel_transfers", // extensions
- "3.0", // gl version
- false, false, false, // has alpha/depth/stencil
- false, false, false, // request alpha/depth/stencil
- true); // bind generates resource
+ InitState init;
+ init.extensions = "GL_CHROMIUM_async_pixel_transfers";
+ init.gl_version = "3.0";
+ init.bind_generates_resource = true;
+ InitDecoder(init);
// Set up the texture.
DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
@@ -8544,16 +8341,10 @@ TEST_F(GLES2DecoderManualInitTest, MemoryTrackerInitialSize) {
scoped_refptr<SizeOnlyMemoryTracker> memory_tracker =
new SizeOnlyMemoryTracker();
set_memory_tracker(memory_tracker.get());
- InitDecoder(
- "", // extensions
- "3.0", // gl version
- false, // has alpha
- false, // has depth
- false, // has stencil
- false, // request alpha
- false, // request depth
- false, // request stencil
- true); // bind generates resource
+ InitState init;
+ init.gl_version = "3.0";
+ init.bind_generates_resource = true;
+ InitDecoder(init);
// Expect that initial size - size is 0.
EXPECT_EQ(0u, memory_tracker->GetPoolSize(MemoryTracker::kUnmanaged));
EXPECT_EQ(0u, memory_tracker->GetPoolSize(MemoryTracker::kManaged));
@@ -8563,16 +8354,10 @@ TEST_F(GLES2DecoderManualInitTest, MemoryTrackerTexImage2D) {
scoped_refptr<SizeOnlyMemoryTracker> memory_tracker =
new SizeOnlyMemoryTracker();
set_memory_tracker(memory_tracker.get());
- InitDecoder(
- "", // extensions
- "3.0", // gl version
- false, // has alpha
- false, // has depth
- false, // has stencil
- false, // request alpha
- false, // request depth
- false, // request stencil
- true); // bind generates resource
+ InitState init;
+ init.gl_version = "3.0";
+ init.bind_generates_resource = true;
+ InitDecoder(init);
DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
EXPECT_CALL(*memory_tracker.get(), EnsureGPUMemoryAvailable(128))
.WillOnce(Return(true)).RetiresOnSaturation();
@@ -8600,16 +8385,10 @@ TEST_F(GLES2DecoderManualInitTest, MemoryTrackerTexStorage2DEXT) {
scoped_refptr<SizeOnlyMemoryTracker> memory_tracker =
new SizeOnlyMemoryTracker();
set_memory_tracker(memory_tracker.get());
- InitDecoder(
- "", // extensions
- "3.0", // gl version
- false, // has alpha
- false, // has depth
- false, // has stencil
- false, // request alpha
- false, // request depth
- false, // request stencil
- true); // bind generates resource
+ InitState init;
+ init.gl_version = "3.0";
+ init.bind_generates_resource = true;
+ InitDecoder(init);
DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
// Check we get out of memory and no call to glTexStorage2DEXT
// if Ensure fails.
@@ -8632,16 +8411,12 @@ TEST_F(GLES2DecoderManualInitTest, MemoryTrackerCopyTexImage2D) {
scoped_refptr<SizeOnlyMemoryTracker> memory_tracker =
new SizeOnlyMemoryTracker();
set_memory_tracker(memory_tracker.get());
- InitDecoder(
- "", // extensions
- "3.0", // gl version
- true, // has alpha
- false, // has depth
- false, // has stencil
- true, // request alpha
- false, // request depth
- false, // request stencil
- true); // bind generates resource
+ InitState init;
+ init.gl_version = "3.0";
+ init.has_alpha = true;
+ init.request_alpha = true;
+ init.bind_generates_resource = true;
+ InitDecoder(init);
DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
EXPECT_CALL(*memory_tracker.get(), EnsureGPUMemoryAvailable(128))
.WillOnce(Return(true)).RetiresOnSaturation();
@@ -8670,16 +8445,10 @@ TEST_F(GLES2DecoderManualInitTest, MemoryTrackerRenderbufferStorage) {
scoped_refptr<SizeOnlyMemoryTracker> memory_tracker =
new SizeOnlyMemoryTracker();
set_memory_tracker(memory_tracker.get());
- InitDecoder(
- "", // extensions
- "3.0", // gl version
- false, // has alpha
- false, // has depth
- false, // has stencil
- false, // request alpha
- false, // request depth
- false, // request stencil
- true); // bind generates resource
+ InitState init;
+ init.gl_version = "3.0";
+ init.bind_generates_resource = true;
+ InitDecoder(init);
DoBindRenderbuffer(GL_RENDERBUFFER, client_renderbuffer_id_,
kServiceRenderbufferId);
EXPECT_CALL(*gl_, GetError())
@@ -8710,16 +8479,10 @@ TEST_F(GLES2DecoderManualInitTest, MemoryTrackerBufferData) {
scoped_refptr<SizeOnlyMemoryTracker> memory_tracker =
new SizeOnlyMemoryTracker();
set_memory_tracker(memory_tracker.get());
- InitDecoder(
- "", // extensions
- "3.0", // gl version
- false, // has alpha
- false, // has depth
- false, // has stencil
- false, // request alpha
- false, // request depth
- false, // request stencil
- true); // bind generates resource
+ InitState init;
+ init.gl_version = "3.0";
+ init.bind_generates_resource = true;
+ InitDecoder(init);
DoBindBuffer(GL_ARRAY_BUFFER, client_buffer_id_,
kServiceBufferId);
EXPECT_CALL(*gl_, GetError())
@@ -8801,15 +8564,9 @@ TEST_F(GLES2DecoderTest, DrawBuffersEXTImmediateBackbuffer) {
}
TEST_F(GLES2DecoderManualInitTest, InvalidateFramebufferBinding) {
- InitDecoder("", // extensions
- "opengl es 3.0", // gl version
- false, // has alpha
- false, // has depth
- false, // has stencil
- false, // request alpha
- false, // request depth
- false, // request stencil
- false); // bind generates resource
+ InitState init;
+ init.gl_version = "opengl es 3.0";
+ InitDecoder(init);
// EXPECT_EQ can't be used to compare function pointers
EXPECT_TRUE(
@@ -8821,15 +8578,10 @@ TEST_F(GLES2DecoderManualInitTest, InvalidateFramebufferBinding) {
}
TEST_F(GLES2DecoderManualInitTest, DiscardFramebufferEXT) {
- InitDecoder("GL_EXT_discard_framebuffer", // extensions
- "opengl es 2.0", // gl version
- false, // has alpha
- false, // has depth
- false, // has stencil
- false, // request alpha
- false, // request depth
- false, // request stencil
- false); // bind generates resource
+ InitState init;
+ init.extensions = "GL_EXT_discard_framebuffer";
+ init.gl_version = "opengl es 2.0";
+ InitDecoder(init);
// EXPECT_EQ can't be used to compare function pointers
EXPECT_TRUE(
@@ -8883,16 +8635,9 @@ TEST_F(GLES2DecoderTest, DiscardFramebufferEXTUnsupported) {
}
TEST_F(GLES2DecoderRestoreStateTest, NullPreviousState) {
- InitDecoder(
- "", // extensions
- "3.0", // gl version
- false, // has alpha
- false, // has depth
- false, // has stencil
- false, // request alpha
- false, // request depth
- false, // request stencil
- false); // bind generates resource
+ InitState init;
+ init.gl_version = "3.0";
+ InitDecoder(init);
SetupTexture();
InSequence sequence;
@@ -8918,21 +8663,14 @@ TEST_F(GLES2DecoderRestoreStateTest, NullPreviousState) {
}
TEST_F(GLES2DecoderRestoreStateTest, WithPreviousState) {
- InitDecoder(
- "", // extensions
- "3.0", // gl version
- false, // has alpha
- false, // has depth
- false, // has stencil
- false, // request alpha
- false, // request depth
- false, // request stencil
- false); // bind generates resource
+ InitState init;
+ init.gl_version = "3.0";
+ InitDecoder(init);
SetupTexture();
// Construct a previous ContextState with all texture bindings
// set to default textures.
- ContextState prev_state(NULL, NULL);
+ ContextState prev_state(NULL, NULL, NULL);
InitializeContextState(&prev_state, std::numeric_limits<uint32>::max(), 0);
InSequence sequence;
@@ -8949,16 +8687,9 @@ TEST_F(GLES2DecoderRestoreStateTest, WithPreviousState) {
}
TEST_F(GLES2DecoderRestoreStateTest, ActiveUnit1) {
- InitDecoder(
- "", // extensions
- "3.0", // gl version
- false, // has alpha
- false, // has depth
- false, // has stencil
- false, // request alpha
- false, // request depth
- false, // request stencil
- false); // bind generates resource
+ InitState init;
+ init.gl_version = "3.0";
+ InitDecoder(init);
// Bind a non-default texture to GL_TEXTURE1 unit.
EXPECT_CALL(*gl_, ActiveTexture(GL_TEXTURE1));
@@ -8970,7 +8701,7 @@ TEST_F(GLES2DecoderRestoreStateTest, ActiveUnit1) {
// Construct a previous ContextState with all texture bindings
// set to default textures.
- ContextState prev_state(NULL, NULL);
+ ContextState prev_state(NULL, NULL, NULL);
InitializeContextState(&prev_state, std::numeric_limits<uint32>::max(), 0);
InSequence sequence;
@@ -8987,16 +8718,9 @@ TEST_F(GLES2DecoderRestoreStateTest, ActiveUnit1) {
}
TEST_F(GLES2DecoderRestoreStateTest, NonDefaultUnit0) {
- InitDecoder(
- "", // extensions
- "3.0", // gl version
- false, // has alpha
- false, // has depth
- false, // has stencil
- false, // request alpha
- false, // request depth
- false, // request stencil
- false); // bind generates resource
+ InitState init;
+ init.gl_version = "3.0";
+ InitDecoder(init);
// Bind a non-default texture to GL_TEXTURE1 unit.
EXPECT_CALL(*gl_, ActiveTexture(GL_TEXTURE1));
@@ -9010,7 +8734,7 @@ TEST_F(GLES2DecoderRestoreStateTest, NonDefaultUnit0) {
// Construct a previous ContextState with GL_TEXTURE_2D target in
// GL_TEXTURE0 unit bound to a non-default texture and the rest
// set to default textures.
- ContextState prev_state(NULL, NULL);
+ ContextState prev_state(NULL, NULL, NULL);
InitializeContextState(&prev_state, 0, kServiceTextureId);
InSequence sequence;
@@ -9032,16 +8756,9 @@ TEST_F(GLES2DecoderRestoreStateTest, NonDefaultUnit0) {
}
TEST_F(GLES2DecoderRestoreStateTest, NonDefaultUnit1) {
- InitDecoder(
- "", // extensions
- "3.0", // gl version
- false, // has alpha
- false, // has depth
- false, // has stencil
- false, // request alpha
- false, // request depth
- false, // request stencil
- false); // bind generates resource
+ InitState init;
+ init.gl_version = "3.0";
+ InitDecoder(init);
// Bind a non-default texture to GL_TEXTURE0 unit.
SetupTexture();
@@ -9049,7 +8766,7 @@ TEST_F(GLES2DecoderRestoreStateTest, NonDefaultUnit1) {
// Construct a previous ContextState with GL_TEXTURE_2D target in
// GL_TEXTURE1 unit bound to a non-default texture and the rest
// set to default textures.
- ContextState prev_state(NULL, NULL);
+ ContextState prev_state(NULL, NULL, NULL);
InitializeContextState(&prev_state, 1, kServiceTextureId);
InSequence sequence;
@@ -9075,17 +8792,12 @@ TEST_F(GLES2DecoderManualInitTest, ClearUniformsBeforeFirstProgramUse) {
command_line.AppendSwitchASCII(
switches::kGpuDriverBugWorkarounds,
base::IntToString(gpu::CLEAR_UNIFORMS_BEFORE_FIRST_PROGRAM_USE));
- InitDecoderWithCommandLine(
- "", // extensions
- "3.0", // gl version
- true, // has alpha
- false, // has depth
- false, // has stencil
- true, // request alpha
- false, // request depth
- false, // request stencil
- true, // bind generates resource
- &command_line);
+ InitState init;
+ init.gl_version = "3.0";
+ init.has_alpha = true;
+ init.request_alpha = true;
+ init.bind_generates_resource = true;
+ InitDecoderWithCommandLine(init, &command_line);
{
static AttribInfo attribs[] = {
{ kAttrib1Name, kAttrib1Size, kAttrib1Type, kAttrib1Location, },
@@ -9122,15 +8834,10 @@ TEST_F(GLES2DecoderManualInitTest, ClearUniformsBeforeFirstProgramUse) {
}
TEST_F(GLES2DecoderManualInitTest, TexImage2DFloatOnGLES2) {
- InitDecoder("GL_OES_texture_float", // extensions
- "opengl es 2.0", // gl version
- false, // has alpha
- false, // has depth
- false, // has stencil
- false, // request alpha
- false, // request depth
- false, // request stencil
- false); // bind generates resource
+ InitState init;
+ init.extensions = "GL_OES_texture_float";
+ init.gl_version = "opengl es 2.0";
+ InitDecoder(init);
DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
DoTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 16, 17, 0, GL_RGBA, GL_FLOAT, 0, 0);
DoTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 16, 17, 0, GL_RGB, GL_FLOAT, 0, 0);
@@ -9143,15 +8850,10 @@ TEST_F(GLES2DecoderManualInitTest, TexImage2DFloatOnGLES2) {
}
TEST_F(GLES2DecoderManualInitTest, TexImage2DFloatOnGLES3) {
- InitDecoder("GL_OES_texture_float GL_EXT_color_buffer_float", // extensions
- "opengl es 3.0", // gl version
- false, // has alpha
- false, // has depth
- false, // has stencil
- false, // request alpha
- false, // request depth
- false, // request stencil
- false); // bind generates resource
+ InitState init;
+ init.extensions = "GL_OES_texture_float GL_EXT_color_buffer_float";
+ init.gl_version = "opengl es 3.0";
+ InitDecoder(init);
DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
DoTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 16, 17, 0, GL_RGBA, GL_FLOAT, 0, 0);
DoTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 16, 17, 0, GL_RGB, GL_FLOAT, 0, 0);
@@ -9166,15 +8868,10 @@ TEST_F(GLES2DecoderManualInitTest, TexImage2DFloatOnGLES3) {
}
TEST_F(GLES2DecoderManualInitTest, TexSubImage2DFloatOnGLES3) {
- InitDecoder("GL_OES_texture_float GL_EXT_color_buffer_float", // extensions
- "opengl es 3.0", // gl version
- false, // has alpha
- false, // has depth
- false, // has stencil
- false, // request alpha
- false, // request depth
- false, // request stencil
- false); // bind generates resource
+ InitState init;
+ init.extensions = "GL_OES_texture_float GL_EXT_color_buffer_float";
+ init.gl_version = "opengl es 3.0";
+ InitDecoder(init);
const int kWidth = 8;
const int kHeight = 4;
DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
@@ -9194,15 +8891,10 @@ TEST_F(GLES2DecoderManualInitTest, TexSubImage2DFloatOnGLES3) {
}
TEST_F(GLES2DecoderManualInitTest, TexSubImage2DFloatDoesClearOnGLES3) {
- InitDecoder("GL_OES_texture_float GL_EXT_color_buffer_float", // extensions
- "opengl es 3.0", // gl version
- false, // has alpha
- false, // has depth
- false, // has stencil
- false, // request alpha
- false, // request depth
- false, // request stencil
- false); // bind generates resource
+ InitState init;
+ init.extensions = "GL_OES_texture_float GL_EXT_color_buffer_float";
+ init.gl_version = "opengl es 3.0";
+ InitDecoder(init);
const int kWidth = 8;
const int kHeight = 4;
DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
@@ -9225,15 +8917,10 @@ TEST_F(GLES2DecoderManualInitTest, TexSubImage2DFloatDoesClearOnGLES3) {
}
TEST_F(GLES2DecoderManualInitTest, TexImage2DFloatConvertsFormatDesktop) {
- InitDecoder("GL_ARB_texture_float", // extensions
- "2.1", // gl version
- false, // has alpha
- false, // has depth
- false, // has stencil
- false, // request alpha
- false, // request depth
- false, // request stencil
- false); // bind generates resource
+ InitState init;
+ init.extensions = "GL_ARB_texture_float";
+ init.gl_version = "2.1";
+ InitDecoder(init);
DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
DoTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA32F, 16, 17, 0, GL_RGBA, GL_FLOAT, 0,
0);
@@ -9253,16 +8940,11 @@ TEST_F(GLES2DecoderManualInitTest, TexImage2DFloatConvertsFormatDesktop) {
}
TEST_F(GLES2DecoderManualInitTest, ReadFormatExtension) {
- InitDecoder(
- "GL_OES_read_format", // extensions
- "2.1", // gl version
- false, // has alpha
- false, // has depth
- false, // has stencil
- false, // request alpha
- false, // request depth
- false, // request stencil
- true); // bind generates resource
+ InitState init;
+ init.extensions = "GL_OES_read_format";
+ init.gl_version = "2.1";
+ init.bind_generates_resource = true;
+ InitDecoder(init);
EXPECT_CALL(*gl_, GetError())
.WillOnce(Return(GL_NO_ERROR))
@@ -9320,16 +9002,10 @@ TEST_F(GLES2DecoderManualInitTest, ReadFormatExtension) {
}
TEST_F(GLES2DecoderManualInitTest, NoReadFormatExtension) {
- InitDecoder(
- "", // extensions
- "2.1", // gl version
- false, // has alpha
- false, // has depth
- false, // has stencil
- false, // request alpha
- false, // request depth
- false, // request stencil
- true); // bind generates resource
+ InitState init;
+ init.gl_version = "2.1";
+ init.bind_generates_resource = true;
+ InitDecoder(init);
EXPECT_CALL(*gl_, GetError())
.WillOnce(Return(GL_NO_ERROR))
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
index 1acdf35266..9a815c87be 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
@@ -14,7 +14,6 @@
#include "gpu/command_buffer/common/gles2_cmd_utils.h"
#include "gpu/command_buffer/service/cmd_buffer_engine.h"
#include "gpu/command_buffer/service/context_group.h"
-#include "gpu/command_buffer/service/gles2_cmd_decoder_mock.h"
#include "gpu/command_buffer/service/logger.h"
#include "gpu/command_buffer/service/program_manager.h"
#include "gpu/command_buffer/service/test_helper.h"
@@ -61,16 +60,14 @@ GLES2DecoderTestBase::GLES2DecoderTestBase()
GLES2DecoderTestBase::~GLES2DecoderTestBase() {}
void GLES2DecoderTestBase::SetUp() {
- InitDecoder(
- "", // extensions
- "3.0", // gl version
- true, // has alpha
- true, // has depth
- false, // has stencil
- true, // request alpha
- true, // request depth
- false, // request stencil
- true); // bind generates resource
+ InitState init;
+ init.gl_version = "3.0";
+ init.has_alpha = true;
+ init.has_depth = true;
+ init.request_alpha = true;
+ init.request_depth = true;
+ init.bind_generates_resource = true;
+ InitDecoder(init);
}
void GLES2DecoderTestBase::AddExpectationsForVertexAttribManager() {
@@ -81,38 +78,22 @@ void GLES2DecoderTestBase::AddExpectationsForVertexAttribManager() {
}
}
-void GLES2DecoderTestBase::InitDecoder(
- const char* extensions,
- const char* gl_version,
- bool has_alpha,
- bool has_depth,
- bool has_stencil,
- bool request_alpha,
- bool request_depth,
- bool request_stencil,
- bool bind_generates_resource) {
- InitDecoderWithCommandLine(extensions,
- gl_version,
- has_alpha,
- has_depth,
- has_stencil,
- request_alpha,
- request_depth,
- request_stencil,
- bind_generates_resource,
- NULL);
+GLES2DecoderTestBase::InitState::InitState()
+ : has_alpha(false),
+ has_depth(false),
+ has_stencil(false),
+ request_alpha(false),
+ request_depth(false),
+ request_stencil(false),
+ bind_generates_resource(false),
+ lose_context_when_out_of_memory(false) {}
+
+void GLES2DecoderTestBase::InitDecoder(const InitState& init) {
+ InitDecoderWithCommandLine(init, NULL);
}
void GLES2DecoderTestBase::InitDecoderWithCommandLine(
- const char* extensions,
- const char* gl_version,
- bool has_alpha,
- bool has_depth,
- bool has_stencil,
- bool request_alpha,
- bool request_depth,
- bool request_stencil,
- bool bind_generates_resource,
+ const InitState& init,
const base::CommandLine* command_line) {
Framebuffer::ClearFramebufferCompleteComboMap();
@@ -124,16 +105,16 @@ void GLES2DecoderTestBase::InitDecoderWithCommandLine(
// Only create stream texture manager if extension is requested.
std::vector<std::string> list;
- base::SplitString(std::string(extensions), ' ', &list);
+ base::SplitString(init.extensions, ' ', &list);
scoped_refptr<FeatureInfo> feature_info;
if (command_line)
feature_info = new FeatureInfo(*command_line);
- group_ = scoped_refptr<ContextGroup>(new ContextGroup(
- NULL,
- NULL,
- memory_tracker_,
- feature_info.get(),
- bind_generates_resource));
+ group_ = scoped_refptr<ContextGroup>(
+ new ContextGroup(NULL,
+ NULL,
+ memory_tracker_,
+ feature_info.get(),
+ init.bind_generates_resource));
InSequence sequence;
@@ -144,14 +125,16 @@ void GLES2DecoderTestBase::InitDecoderWithCommandLine(
// in turn initialize FeatureInfo, which needs a context to determine
// extension support.
context_ = new gfx::GLContextStubWithExtensions;
- context_->AddExtensionsString(extensions);
- context_->SetGLVersionString(gl_version);
+ context_->AddExtensionsString(init.extensions.c_str());
+ context_->SetGLVersionString(init.gl_version.c_str());
context_->MakeCurrent(surface_.get());
gfx::GLSurface::InitializeDynamicMockBindingsForTests(context_);
TestHelper::SetupContextGroupInitExpectations(gl_.get(),
- DisallowedFeatures(), extensions, gl_version);
+ DisallowedFeatures(),
+ init.extensions.c_str(),
+ init.gl_version.c_str());
// We initialize the ContextGroup with a MockGLES2Decoder so that
// we can use the ContextGroup to figure out how the real GLES2Decoder
@@ -228,14 +211,14 @@ void GLES2DecoderTestBase::InitDecoderWithCommandLine(
.Times(1)
.RetiresOnSaturation();
EXPECT_CALL(*gl_, GetIntegerv(GL_ALPHA_BITS, _))
- .WillOnce(SetArgumentPointee<1>(has_alpha ? 8 : 0))
- .RetiresOnSaturation();
+ .WillOnce(SetArgumentPointee<1>(init.has_alpha ? 8 : 0))
+ .RetiresOnSaturation();
EXPECT_CALL(*gl_, GetIntegerv(GL_DEPTH_BITS, _))
- .WillOnce(SetArgumentPointee<1>(has_depth ? 24 : 0))
- .RetiresOnSaturation();
+ .WillOnce(SetArgumentPointee<1>(init.has_depth ? 24 : 0))
+ .RetiresOnSaturation();
EXPECT_CALL(*gl_, GetIntegerv(GL_STENCIL_BITS, _))
- .WillOnce(SetArgumentPointee<1>(has_stencil ? 8 : 0))
- .RetiresOnSaturation();
+ .WillOnce(SetArgumentPointee<1>(init.has_stencil ? 8 : 0))
+ .RetiresOnSaturation();
EXPECT_CALL(*gl_, Enable(GL_VERTEX_PROGRAM_POINT_SIZE))
.Times(1)
@@ -292,11 +275,16 @@ void GLES2DecoderTestBase::InitDecoderWithCommandLine(
shared_memory_id_ = kSharedMemoryId;
shared_memory_base_ = buffer->memory();
- int32 attributes[] = {
- EGL_ALPHA_SIZE, request_alpha ? 8 : 0,
- EGL_DEPTH_SIZE, request_depth ? 24 : 0,
- EGL_STENCIL_SIZE, request_stencil ? 8 : 0,
- };
+ static const int32 kLoseContextWhenOutOfMemory = 0x10003;
+
+ int32 attributes[] = {EGL_ALPHA_SIZE,
+ init.request_alpha ? 8 : 0,
+ EGL_DEPTH_SIZE,
+ init.request_depth ? 24 : 0,
+ EGL_STENCIL_SIZE,
+ init.request_stencil ? 8 : 0,
+ kLoseContextWhenOutOfMemory,
+ init.lose_context_when_out_of_memory ? 1 : 0, };
std::vector<int32> attribs(attributes, attributes + arraysize(attributes));
decoder_.reset(GLES2Decoder::Create(group_.get()));
@@ -1423,7 +1411,7 @@ MockCommandBufferEngine() {
scoped_ptr<base::SharedMemory> shm(new base::SharedMemory());
shm->CreateAndMapAnonymous(kSharedBufferSize);
- valid_buffer_ = new gpu::Buffer(shm.Pass(), kSharedBufferSize);
+ valid_buffer_ = MakeBufferFromSharedMemory(shm.Pass(), kSharedBufferSize);
ClearSharedMemory();
}
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h
index 5ceb44511d..24a960e440 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h
@@ -12,6 +12,7 @@
#include "gpu/command_buffer/service/context_group.h"
#include "gpu/command_buffer/service/framebuffer_manager.h"
#include "gpu/command_buffer/service/gles2_cmd_decoder.h"
+#include "gpu/command_buffer/service/gles2_cmd_decoder_mock.h"
#include "gpu/command_buffer/service/program_manager.h"
#include "gpu/command_buffer/service/query_manager.h"
#include "gpu/command_buffer/service/renderbuffer_manager.h"
@@ -150,28 +151,24 @@ class GLES2DecoderTestBase : public testing::Test {
memory_tracker_ = memory_tracker;
}
- void InitDecoder(
- const char* extensions,
- const char* gl_version,
- bool has_alpha,
- bool has_depth,
- bool has_stencil,
- bool request_alpha,
- bool request_depth,
- bool request_stencil,
- bool bind_generates_resource);
-
- void InitDecoderWithCommandLine(
- const char* extensions,
- const char* gl_version,
- bool has_alpha,
- bool has_depth,
- bool has_stencil,
- bool request_alpha,
- bool request_depth,
- bool request_stencil,
- bool bind_generates_resource,
- const base::CommandLine* command_line);
+ struct InitState {
+ InitState();
+
+ std::string extensions;
+ std::string gl_version;
+ bool has_alpha;
+ bool has_depth;
+ bool has_stencil;
+ bool request_alpha;
+ bool request_depth;
+ bool request_stencil;
+ bool bind_generates_resource;
+ bool lose_context_when_out_of_memory;
+ };
+
+ void InitDecoder(const InitState& init);
+ void InitDecoderWithCommandLine(const InitState& init,
+ const base::CommandLine* command_line);
void ResetDecoder();
@@ -489,7 +486,7 @@ class GLES2DecoderTestBase : public testing::Test {
scoped_ptr< ::testing::StrictMock< ::gfx::MockGLInterface> > gl_;
scoped_refptr<gfx::GLSurfaceStub> surface_;
scoped_refptr<gfx::GLContextStubWithExtensions> context_;
- scoped_ptr<GLES2Decoder> mock_decoder_;
+ scoped_ptr<MockGLES2Decoder> mock_decoder_;
scoped_ptr<GLES2Decoder> decoder_;
MemoryTracker* memory_tracker_;
diff --git a/gpu/command_buffer/service/gpu_scheduler.cc b/gpu/command_buffer/service/gpu_scheduler.cc
index bce2fdd9c9..928371efc7 100644
--- a/gpu/command_buffer/service/gpu_scheduler.cc
+++ b/gpu/command_buffer/service/gpu_scheduler.cc
@@ -28,7 +28,7 @@ const int64 kUnscheduleFenceTimeOutDelay = 10000;
const int64 kRescheduleTimeOutDelay = 1000;
#endif
-GpuScheduler::GpuScheduler(CommandBuffer* command_buffer,
+GpuScheduler::GpuScheduler(CommandBufferServiceBase* command_buffer,
AsyncAPIInterface* handler,
gles2::GLES2Decoder* decoder)
: command_buffer_(command_buffer),
diff --git a/gpu/command_buffer/service/gpu_scheduler.h b/gpu/command_buffer/service/gpu_scheduler.h
index 22ab07fe88..5e073ca54e 100644
--- a/gpu/command_buffer/service/gpu_scheduler.h
+++ b/gpu/command_buffer/service/gpu_scheduler.h
@@ -15,9 +15,9 @@
#include "base/memory/scoped_ptr.h"
#include "base/memory/shared_memory.h"
#include "base/memory/weak_ptr.h"
-#include "gpu/command_buffer/common/command_buffer.h"
#include "gpu/command_buffer/service/cmd_buffer_engine.h"
#include "gpu/command_buffer/service/cmd_parser.h"
+#include "gpu/command_buffer/service/command_buffer_service.h"
#include "gpu/command_buffer/service/gles2_cmd_decoder.h"
#include "gpu/gpu_export.h"
@@ -52,7 +52,7 @@ class GPU_EXPORT GpuScheduler
: NON_EXPORTED_BASE(public CommandBufferEngine),
public base::SupportsWeakPtr<GpuScheduler> {
public:
- GpuScheduler(CommandBuffer* command_buffer,
+ GpuScheduler(CommandBufferServiceBase* command_buffer,
AsyncAPIInterface* handler,
gles2::GLES2Decoder* decoder);
@@ -114,7 +114,7 @@ class GPU_EXPORT GpuScheduler
// The GpuScheduler holds a weak reference to the CommandBuffer. The
// CommandBuffer owns the GpuScheduler and holds a strong reference to it
// through the ProcessCommands callback.
- CommandBuffer* command_buffer_;
+ CommandBufferServiceBase* command_buffer_;
// The parser uses this to execute commands.
AsyncAPIInterface* handler_;
diff --git a/gpu/command_buffer/service/gpu_scheduler_unittest.cc b/gpu/command_buffer/service/gpu_scheduler_unittest.cc
index 7a663d0eb3..68592083de 100644
--- a/gpu/command_buffer/service/gpu_scheduler_unittest.cc
+++ b/gpu/command_buffer/service/gpu_scheduler_unittest.cc
@@ -37,7 +37,7 @@ class GpuSchedulerTest : public testing::Test {
shared_memory->CreateAndMapAnonymous(kRingBufferSize);
buffer_ = static_cast<int32*>(shared_memory->memory());
shared_memory_buffer_ =
- new gpu::Buffer(shared_memory.Pass(), kRingBufferSize);
+ MakeBufferFromSharedMemory(shared_memory.Pass(), kRingBufferSize);
memset(buffer_, 0, kRingBufferSize);
command_buffer_.reset(new MockCommandBuffer);
diff --git a/gpu/command_buffer/service/gpu_switches.cc b/gpu/command_buffer/service/gpu_switches.cc
index 3f03bdfbf6..0491c413e5 100644
--- a/gpu/command_buffer/service/gpu_switches.cc
+++ b/gpu/command_buffer/service/gpu_switches.cc
@@ -43,9 +43,6 @@ const char kEnforceGLMinimums[] = "enforce-gl-minimums";
// Sets the total amount of memory that may be allocated for GPU resources
const char kForceGpuMemAvailableMb[] = "force-gpu-mem-available-mb";
-// Force the synchronous copy path in compositing_iosurface_mac.
-const char kForceSynchronousGLReadPixels[] = "force-synchronous-glreadpixels";
-
// Pass a set of GpuDriverBugWorkaroundType ids, seperated by ','.
const char kGpuDriverBugWorkarounds[] = "gpu-driver-bug-workarounds";
@@ -71,7 +68,6 @@ const char* kGpuSwitches[] = {
kDisableGpuProgramCache,
kEnforceGLMinimums,
kForceGpuMemAvailableMb,
- kForceSynchronousGLReadPixels,
kGpuDriverBugWorkarounds,
kGpuProgramCacheSizeKb,
kDisableGpuShaderDiskCache,
diff --git a/gpu/command_buffer/service/gpu_switches.h b/gpu/command_buffer/service/gpu_switches.h
index f76a2f0989..d582b7ae26 100644
--- a/gpu/command_buffer/service/gpu_switches.h
+++ b/gpu/command_buffer/service/gpu_switches.h
@@ -22,7 +22,6 @@ GPU_EXPORT extern const char kEnableGPUServiceLoggingGPU[];
GPU_EXPORT extern const char kDisableGpuProgramCache[];
GPU_EXPORT extern const char kEnforceGLMinimums[];
GPU_EXPORT extern const char kForceGpuMemAvailableMb[];
-GPU_EXPORT extern const char kForceSynchronousGLReadPixels[];
GPU_EXPORT extern const char kGpuDriverBugWorkarounds[];
GPU_EXPORT extern const char kGpuProgramCacheSizeKb[];
GPU_EXPORT extern const char kDisableGpuShaderDiskCache[];
diff --git a/gpu/command_buffer/service/in_process_command_buffer.cc b/gpu/command_buffer/service/in_process_command_buffer.cc
index 97ec15e557..71faba607c 100644
--- a/gpu/command_buffer/service/in_process_command_buffer.cc
+++ b/gpu/command_buffer/service/in_process_command_buffer.cc
@@ -586,11 +586,6 @@ void InProcessCommandBuffer::DestroyTransferBuffer(int32 id) {
QueueTask(task);
}
-scoped_refptr<gpu::Buffer> InProcessCommandBuffer::GetTransferBuffer(int32 id) {
- NOTREACHED();
- return NULL;
-}
-
gpu::Capabilities InProcessCommandBuffer::GetCapabilities() {
return capabilities_;
}
@@ -708,19 +703,6 @@ bool InProcessCommandBuffer::Initialize() {
return false;
}
-void InProcessCommandBuffer::SetGetOffset(int32 get_offset) { NOTREACHED(); }
-
-void InProcessCommandBuffer::SetToken(int32 token) { NOTREACHED(); }
-
-void InProcessCommandBuffer::SetParseError(gpu::error::Error error) {
- NOTREACHED();
-}
-
-void InProcessCommandBuffer::SetContextLostReason(
- gpu::error::ContextLostReason reason) {
- NOTREACHED();
-}
-
namespace {
void PostCallback(const scoped_refptr<base::MessageLoopProxy>& loop,
diff --git a/gpu/command_buffer/service/in_process_command_buffer.h b/gpu/command_buffer/service/in_process_command_buffer.h
index 4b9f54ac16..b5068169d1 100644
--- a/gpu/command_buffer/service/in_process_command_buffer.h
+++ b/gpu/command_buffer/service/in_process_command_buffer.h
@@ -48,6 +48,7 @@ namespace gles2 {
class GLES2Decoder;
}
+class CommandBufferServiceBase;
class GpuMemoryBufferFactory;
class GpuScheduler;
class TransferBufferManagerInterface;
@@ -87,15 +88,9 @@ class GPU_EXPORT InProcessCommandBuffer : public CommandBuffer,
virtual void WaitForTokenInRange(int32 start, int32 end) OVERRIDE;
virtual void WaitForGetOffsetInRange(int32 start, int32 end) OVERRIDE;
virtual void SetGetBuffer(int32 shm_id) OVERRIDE;
- virtual void SetGetOffset(int32 get_offset) OVERRIDE;
virtual scoped_refptr<gpu::Buffer> CreateTransferBuffer(size_t size,
int32* id) OVERRIDE;
virtual void DestroyTransferBuffer(int32 id) OVERRIDE;
- virtual scoped_refptr<gpu::Buffer> GetTransferBuffer(int32 id) OVERRIDE;
- virtual void SetToken(int32 token) OVERRIDE;
- virtual void SetParseError(gpu::error::Error error) OVERRIDE;
- virtual void SetContextLostReason(
- gpu::error::ContextLostReason reason) OVERRIDE;
virtual gpu::error::Error GetLastError() OVERRIDE;
// GpuControl implementation:
@@ -205,7 +200,7 @@ class GPU_EXPORT InProcessCommandBuffer : public CommandBuffer,
gpu::Capabilities capabilities_;
// Accessed on both threads:
- scoped_ptr<CommandBuffer> command_buffer_;
+ scoped_ptr<CommandBufferServiceBase> command_buffer_;
base::Lock command_buffer_lock_;
base::WaitableEvent flush_event_;
scoped_refptr<Service> service_;
diff --git a/gpu/command_buffer/service/query_manager_unittest.cc b/gpu/command_buffer/service/query_manager_unittest.cc
index b5f6609e63..0acbbece1d 100644
--- a/gpu/command_buffer/service/query_manager_unittest.cc
+++ b/gpu/command_buffer/service/query_manager_unittest.cc
@@ -93,7 +93,8 @@ class QueryManagerTest : public testing::Test {
MockCommandBufferEngine() {
scoped_ptr<base::SharedMemory> shared_memory(new base::SharedMemory());
shared_memory->CreateAndMapAnonymous(kSharedBufferSize);
- valid_buffer_ = new gpu::Buffer(shared_memory.Pass(), kSharedBufferSize);
+ valid_buffer_ =
+ MakeBufferFromSharedMemory(shared_memory.Pass(), kSharedBufferSize);
data_ = static_cast<uint8*>(valid_buffer_->memory());
ClearSharedMemory();
}
diff --git a/gpu/command_buffer/service/shader_translator.cc b/gpu/command_buffer/service/shader_translator.cc
index 333e2c6add..abf4c3e71b 100644
--- a/gpu/command_buffer/service/shader_translator.cc
+++ b/gpu/command_buffer/service/shader_translator.cc
@@ -205,7 +205,12 @@ bool ShaderTranslator::Translate(const char* shader) {
std::string ShaderTranslator::GetStringForOptionsThatWouldEffectCompilation()
const {
+
+#if ANGLE_SH_VERSION >= 122
+ const size_t kNumIntFields = 20;
+#else
const size_t kNumIntFields = 16;
+#endif
const size_t kNumEnumFields = 1;
const size_t kNumFunctionPointerFields = 1;
struct MustMatchShBuiltInResource {
@@ -256,7 +261,19 @@ std::string ShaderTranslator::GetStringForOptionsThatWouldEffectCompilation()
":MaxCallStackDepth:" +
base::IntToString(compiler_options_.MaxCallStackDepth) +
":EXT_frag_depth:" +
+#if ANGLE_SH_VERSION >= 122
+ base::IntToString(compiler_options_.EXT_frag_depth) +
+ ":MaxVertexOutputVectors:" +
+ base::IntToString(compiler_options_.MaxVertexOutputVectors) +
+ ":MaxFragmentInputVectors:" +
+ base::IntToString(compiler_options_.MaxFragmentInputVectors) +
+ ":MinProgramTexelOffset:" +
+ base::IntToString(compiler_options_.MinProgramTexelOffset) +
+ ":MaxProgramTexelOffset:" +
+ base::IntToString(compiler_options_.MaxProgramTexelOffset));
+#else
base::IntToString(compiler_options_.EXT_frag_depth));
+#endif
}
const char* ShaderTranslator::translated_shader() const {
diff --git a/gpu/command_buffer/service/transfer_buffer_manager.cc b/gpu/command_buffer/service/transfer_buffer_manager.cc
index 7f81115b85..4404a9eb6c 100644
--- a/gpu/command_buffer/service/transfer_buffer_manager.cc
+++ b/gpu/command_buffer/service/transfer_buffer_manager.cc
@@ -40,8 +40,7 @@ bool TransferBufferManager::Initialize() {
bool TransferBufferManager::RegisterTransferBuffer(
int32 id,
- scoped_ptr<base::SharedMemory> shared_memory,
- size_t size) {
+ scoped_ptr<BufferBacking> buffer_backing) {
if (id <= 0) {
DVLOG(0) << "Cannot register transfer buffer with non-positive ID.";
return false;
@@ -54,13 +53,13 @@ bool TransferBufferManager::RegisterTransferBuffer(
}
// Register the shared memory with the ID.
- scoped_refptr<Buffer> buffer = new gpu::Buffer(shared_memory.Pass(), size);
+ scoped_refptr<Buffer> buffer(new gpu::Buffer(buffer_backing.Pass()));
// Check buffer alignment is sane.
DCHECK(!(reinterpret_cast<uintptr_t>(buffer->memory()) &
(kCommandBufferEntrySize - 1)));
- shared_memory_bytes_allocated_ += size;
+ shared_memory_bytes_allocated_ += buffer->size();
TRACE_COUNTER_ID1(
"gpu", "GpuTransferBufferMemory", this, shared_memory_bytes_allocated_);
diff --git a/gpu/command_buffer/service/transfer_buffer_manager.h b/gpu/command_buffer/service/transfer_buffer_manager.h
index 5f8f946791..d8bb3bb4fd 100644
--- a/gpu/command_buffer/service/transfer_buffer_manager.h
+++ b/gpu/command_buffer/service/transfer_buffer_manager.h
@@ -20,10 +20,8 @@ class GPU_EXPORT TransferBufferManagerInterface {
public:
virtual ~TransferBufferManagerInterface();
- virtual bool RegisterTransferBuffer(
- int32 id,
- scoped_ptr<base::SharedMemory> shared_memory,
- size_t size) = 0;
+ virtual bool RegisterTransferBuffer(int32 id,
+ scoped_ptr<BufferBacking> buffer) = 0;
virtual void DestroyTransferBuffer(int32 id) = 0;
virtual scoped_refptr<Buffer> GetTransferBuffer(int32 id) = 0;
};
@@ -34,10 +32,9 @@ class GPU_EXPORT TransferBufferManager
TransferBufferManager();
bool Initialize();
- virtual bool RegisterTransferBuffer(
- int32 id,
- scoped_ptr<base::SharedMemory> shared_memory,
- size_t size) OVERRIDE;
+ virtual bool RegisterTransferBuffer(int32 id,
+ scoped_ptr<BufferBacking> buffer_backing)
+ OVERRIDE;
virtual void DestroyTransferBuffer(int32 id) OVERRIDE;
virtual scoped_refptr<Buffer> GetTransferBuffer(int32 id) OVERRIDE;
diff --git a/gpu/command_buffer/service/transfer_buffer_manager_unittest.cc b/gpu/command_buffer/service/transfer_buffer_manager_unittest.cc
index c7dc04a837..4af09368cb 100644
--- a/gpu/command_buffer/service/transfer_buffer_manager_unittest.cc
+++ b/gpu/command_buffer/service/transfer_buffer_manager_unittest.cc
@@ -41,20 +41,34 @@ TEST_F(TransferBufferManagerTest, CanRegisterTransferBuffer) {
scoped_ptr<base::SharedMemory> shm(new base::SharedMemory());
shm->CreateAndMapAnonymous(kBufferSize);
base::SharedMemory* shm_raw_pointer = shm.get();
+ scoped_ptr<SharedMemoryBufferBacking> backing(
+ new SharedMemoryBufferBacking(shm.Pass(), kBufferSize));
+ SharedMemoryBufferBacking* backing_raw_ptr = backing.get();
+
EXPECT_TRUE(transfer_buffer_manager_->RegisterTransferBuffer(
- 1, shm.Pass(), kBufferSize));
+ 1, backing.PassAs<BufferBacking>()));
scoped_refptr<Buffer> registered =
transfer_buffer_manager_->GetTransferBuffer(1);
// Shared-memory ownership is transfered. It should be the same memory.
- EXPECT_EQ(shm_raw_pointer, registered->shared_memory());
+ EXPECT_EQ(backing_raw_ptr, registered->backing());
+ EXPECT_EQ(shm_raw_pointer, backing_raw_ptr->shared_memory());
}
+class FakeBufferBacking : public BufferBacking {
+ public:
+ virtual void* GetMemory() const OVERRIDE {
+ return reinterpret_cast<void*>(0xBADF00D0);
+ }
+ virtual size_t GetSize() const OVERRIDE { return 42; }
+ static scoped_ptr<BufferBacking> Make() {
+ return scoped_ptr<BufferBacking>(new FakeBufferBacking);
+ }
+};
+
TEST_F(TransferBufferManagerTest, CanDestroyTransferBuffer) {
- scoped_ptr<base::SharedMemory> shm(new base::SharedMemory());
- shm->CreateAndMapAnonymous(kBufferSize);
EXPECT_TRUE(transfer_buffer_manager_->RegisterTransferBuffer(
- 1, shm.Pass(), kBufferSize));
+ 1, scoped_ptr<BufferBacking>(new FakeBufferBacking)));
transfer_buffer_manager_->DestroyTransferBuffer(1);
scoped_refptr<Buffer> registered =
transfer_buffer_manager_->GetTransferBuffer(1);
@@ -64,31 +78,20 @@ TEST_F(TransferBufferManagerTest, CanDestroyTransferBuffer) {
}
TEST_F(TransferBufferManagerTest, CannotRegregisterTransferBufferId) {
- scoped_ptr<base::SharedMemory> shm1(new base::SharedMemory());
- scoped_ptr<base::SharedMemory> shm2(new base::SharedMemory());
- scoped_ptr<base::SharedMemory> shm3(new base::SharedMemory());
- shm1->CreateAndMapAnonymous(kBufferSize);
- shm2->CreateAndMapAnonymous(kBufferSize);
- shm3->CreateAndMapAnonymous(kBufferSize);
-
EXPECT_TRUE(transfer_buffer_manager_->RegisterTransferBuffer(
- 1, shm1.Pass(), kBufferSize));
+ 1, FakeBufferBacking::Make()));
EXPECT_FALSE(transfer_buffer_manager_->RegisterTransferBuffer(
- 1, shm2.Pass(), kBufferSize));
+ 1, FakeBufferBacking::Make()));
EXPECT_FALSE(transfer_buffer_manager_->RegisterTransferBuffer(
- 1, shm3.Pass(), kBufferSize));
+ 1, FakeBufferBacking::Make()));
}
TEST_F(TransferBufferManagerTest, CanReuseTransferBufferIdAfterDestroying) {
- scoped_ptr<base::SharedMemory> shm1(new base::SharedMemory());
- scoped_ptr<base::SharedMemory> shm2(new base::SharedMemory());
- shm1->CreateAndMapAnonymous(kBufferSize);
- shm2->CreateAndMapAnonymous(kBufferSize);
EXPECT_TRUE(transfer_buffer_manager_->RegisterTransferBuffer(
- 1, shm1.Pass(), kBufferSize));
+ 1, FakeBufferBacking::Make()));
transfer_buffer_manager_->DestroyTransferBuffer(1);
EXPECT_TRUE(transfer_buffer_manager_->RegisterTransferBuffer(
- 1, shm2.Pass(), kBufferSize));
+ 1, FakeBufferBacking::Make()));
}
TEST_F(TransferBufferManagerTest, DestroyUnusedTransferBufferIdDoesNotCrash) {
@@ -96,17 +99,15 @@ TEST_F(TransferBufferManagerTest, DestroyUnusedTransferBufferIdDoesNotCrash) {
}
TEST_F(TransferBufferManagerTest, CannotRegisterNullTransferBuffer) {
- scoped_ptr<base::SharedMemory> shm(new base::SharedMemory());
- shm->CreateAndMapAnonymous(kBufferSize);
EXPECT_FALSE(transfer_buffer_manager_->RegisterTransferBuffer(
- 0, shm.Pass(), kBufferSize));
+ 0, FakeBufferBacking::Make()));
}
TEST_F(TransferBufferManagerTest, CannotRegisterNegativeTransferBufferId) {
scoped_ptr<base::SharedMemory> shm(new base::SharedMemory());
shm->CreateAndMapAnonymous(kBufferSize);
EXPECT_FALSE(transfer_buffer_manager_->RegisterTransferBuffer(
- -1, shm.Pass(), kBufferSize));
+ -1, FakeBufferBacking::Make()));
}
} // namespace gpu
diff --git a/gpu/command_buffer/tests/gl_gpu_memory_buffer_unittest.cc b/gpu/command_buffer/tests/gl_gpu_memory_buffer_unittest.cc
index 95ae95882a..5948d76c35 100644
--- a/gpu/command_buffer/tests/gl_gpu_memory_buffer_unittest.cc
+++ b/gpu/command_buffer/tests/gl_gpu_memory_buffer_unittest.cc
@@ -42,7 +42,7 @@ class MockGpuMemoryBuffer : public gfx::GpuMemoryBuffer {
Die();
}
- MOCK_METHOD2(Map, void(gfx::GpuMemoryBuffer::AccessMode, void**));
+ MOCK_METHOD1(Map, void*(gfx::GpuMemoryBuffer::AccessMode));
MOCK_METHOD0(Unmap, void());
MOCK_CONST_METHOD0(IsMapped, bool());
MOCK_CONST_METHOD0(GetStride, uint32());
@@ -149,9 +149,9 @@ TEST_F(MockGpuMemoryBufferTest, Lifecycle) {
shared_memory.Map(bytes);
EXPECT_TRUE(shared_memory.memory());
- EXPECT_CALL(*gpu_memory_buffer, Map(_, _))
+ EXPECT_CALL(*gpu_memory_buffer, Map(gfx::GpuMemoryBuffer::READ_WRITE))
.Times(1)
- .WillOnce(SetArgPointee<1>(shared_memory.memory()))
+ .WillOnce(Return(shared_memory.memory()))
.RetiresOnSaturation();
uint8* mapped_buffer = static_cast<uint8*>(
glMapImageCHROMIUM(image_id, GL_READ_WRITE));
diff --git a/gpu/command_buffer/tests/gl_manager.cc b/gpu/command_buffer/tests/gl_manager.cc
index e8d6452d69..dc30f454f3 100644
--- a/gpu/command_buffer/tests/gl_manager.cc
+++ b/gpu/command_buffer/tests/gl_manager.cc
@@ -39,9 +39,9 @@ GLManager::Options::Options()
share_mailbox_manager(NULL),
virtual_manager(NULL),
bind_generates_resource(false),
+ lose_context_when_out_of_memory(false),
context_lost_allowed(false),
- image_manager(NULL) {
-}
+ image_manager(NULL) {}
GLManager::GLManager()
: context_lost_allowed_(false) {
@@ -189,12 +189,13 @@ void GLManager::Initialize(const GLManager::Options& options) {
transfer_buffer_.reset(new TransferBuffer(gles2_helper_.get()));
// Create the object exposing the OpenGL API.
- gles2_implementation_.reset(new gles2::GLES2Implementation(
- gles2_helper_.get(),
- client_share_group,
- transfer_buffer_.get(),
- options.bind_generates_resource,
- gpu_control_.get()));
+ gles2_implementation_.reset(
+ new gles2::GLES2Implementation(gles2_helper_.get(),
+ client_share_group,
+ transfer_buffer_.get(),
+ options.bind_generates_resource,
+ options.lose_context_when_out_of_memory,
+ gpu_control_.get()));
ASSERT_TRUE(gles2_implementation_->Initialize(
kStartTransferBufferSize,
diff --git a/gpu/command_buffer/tests/gl_manager.h b/gpu/command_buffer/tests/gl_manager.h
index 8a811fdf7c..6eb5909515 100644
--- a/gpu/command_buffer/tests/gl_manager.h
+++ b/gpu/command_buffer/tests/gl_manager.h
@@ -53,6 +53,8 @@ class GLManager {
GLManager* virtual_manager;
// Whether or not glBindXXX generates a resource.
bool bind_generates_resource;
+ // Whether or not the context is auto-lost when GL_OUT_OF_MEMORY occurs.
+ bool lose_context_when_out_of_memory;
// Whether or not it's ok to lose the context.
bool context_lost_allowed;
// Image manager to be used.
diff --git a/gpu/command_buffer_client.target.darwin-arm.mk b/gpu/command_buffer_client.target.darwin-arm.mk
index c72f58ac96..7e4ac324e4 100644
--- a/gpu/command_buffer_client.target.darwin-arm.mk
+++ b/gpu/command_buffer_client.target.darwin-arm.mk
@@ -74,6 +74,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -161,6 +162,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/command_buffer_client.target.darwin-mips.mk b/gpu/command_buffer_client.target.darwin-mips.mk
index 9097c577df..c465ac3f1e 100644
--- a/gpu/command_buffer_client.target.darwin-mips.mk
+++ b/gpu/command_buffer_client.target.darwin-mips.mk
@@ -73,6 +73,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -159,6 +160,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/command_buffer_client.target.darwin-x86.mk b/gpu/command_buffer_client.target.darwin-x86.mk
index 273567e047..1f07c308b9 100644
--- a/gpu/command_buffer_client.target.darwin-x86.mk
+++ b/gpu/command_buffer_client.target.darwin-x86.mk
@@ -75,6 +75,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -162,6 +163,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/command_buffer_client.target.darwin-x86_64.mk b/gpu/command_buffer_client.target.darwin-x86_64.mk
index 7011383b8c..ef94e7a564 100644
--- a/gpu/command_buffer_client.target.darwin-x86_64.mk
+++ b/gpu/command_buffer_client.target.darwin-x86_64.mk
@@ -75,6 +75,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -162,6 +163,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/command_buffer_client.target.linux-arm.mk b/gpu/command_buffer_client.target.linux-arm.mk
index c72f58ac96..7e4ac324e4 100644
--- a/gpu/command_buffer_client.target.linux-arm.mk
+++ b/gpu/command_buffer_client.target.linux-arm.mk
@@ -74,6 +74,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -161,6 +162,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/command_buffer_client.target.linux-mips.mk b/gpu/command_buffer_client.target.linux-mips.mk
index 9097c577df..c465ac3f1e 100644
--- a/gpu/command_buffer_client.target.linux-mips.mk
+++ b/gpu/command_buffer_client.target.linux-mips.mk
@@ -73,6 +73,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -159,6 +160,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/command_buffer_client.target.linux-x86.mk b/gpu/command_buffer_client.target.linux-x86.mk
index 273567e047..1f07c308b9 100644
--- a/gpu/command_buffer_client.target.linux-x86.mk
+++ b/gpu/command_buffer_client.target.linux-x86.mk
@@ -75,6 +75,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -162,6 +163,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/command_buffer_client.target.linux-x86_64.mk b/gpu/command_buffer_client.target.linux-x86_64.mk
index 7011383b8c..ef94e7a564 100644
--- a/gpu/command_buffer_client.target.linux-x86_64.mk
+++ b/gpu/command_buffer_client.target.linux-x86_64.mk
@@ -75,6 +75,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -162,6 +163,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/command_buffer_common.target.darwin-arm.mk b/gpu/command_buffer_common.target.darwin-arm.mk
index 77db218e31..564755dfd1 100644
--- a/gpu/command_buffer_common.target.darwin-arm.mk
+++ b/gpu/command_buffer_common.target.darwin-arm.mk
@@ -77,6 +77,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -164,6 +165,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/command_buffer_common.target.darwin-mips.mk b/gpu/command_buffer_common.target.darwin-mips.mk
index 4acce79d60..6a78e1caa6 100644
--- a/gpu/command_buffer_common.target.darwin-mips.mk
+++ b/gpu/command_buffer_common.target.darwin-mips.mk
@@ -76,6 +76,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -162,6 +163,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/command_buffer_common.target.darwin-x86.mk b/gpu/command_buffer_common.target.darwin-x86.mk
index fa4984ed26..e58dbc7d00 100644
--- a/gpu/command_buffer_common.target.darwin-x86.mk
+++ b/gpu/command_buffer_common.target.darwin-x86.mk
@@ -78,6 +78,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -165,6 +166,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/command_buffer_common.target.darwin-x86_64.mk b/gpu/command_buffer_common.target.darwin-x86_64.mk
index cf80487636..4fee1d3a6a 100644
--- a/gpu/command_buffer_common.target.darwin-x86_64.mk
+++ b/gpu/command_buffer_common.target.darwin-x86_64.mk
@@ -78,6 +78,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -165,6 +166,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/command_buffer_common.target.linux-arm.mk b/gpu/command_buffer_common.target.linux-arm.mk
index 77db218e31..564755dfd1 100644
--- a/gpu/command_buffer_common.target.linux-arm.mk
+++ b/gpu/command_buffer_common.target.linux-arm.mk
@@ -77,6 +77,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -164,6 +165,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/command_buffer_common.target.linux-mips.mk b/gpu/command_buffer_common.target.linux-mips.mk
index 4acce79d60..6a78e1caa6 100644
--- a/gpu/command_buffer_common.target.linux-mips.mk
+++ b/gpu/command_buffer_common.target.linux-mips.mk
@@ -76,6 +76,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -162,6 +163,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/command_buffer_common.target.linux-x86.mk b/gpu/command_buffer_common.target.linux-x86.mk
index fa4984ed26..e58dbc7d00 100644
--- a/gpu/command_buffer_common.target.linux-x86.mk
+++ b/gpu/command_buffer_common.target.linux-x86.mk
@@ -78,6 +78,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -165,6 +166,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/command_buffer_common.target.linux-x86_64.mk b/gpu/command_buffer_common.target.linux-x86_64.mk
index cf80487636..4fee1d3a6a 100644
--- a/gpu/command_buffer_common.target.linux-x86_64.mk
+++ b/gpu/command_buffer_common.target.linux-x86_64.mk
@@ -78,6 +78,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -165,6 +166,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/command_buffer_service.target.darwin-arm.mk b/gpu/command_buffer_service.target.darwin-arm.mk
index 3a6caf00a5..ce1dcd7510 100644
--- a/gpu/command_buffer_service.target.darwin-arm.mk
+++ b/gpu/command_buffer_service.target.darwin-arm.mk
@@ -120,6 +120,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -251,6 +252,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/command_buffer_service.target.darwin-mips.mk b/gpu/command_buffer_service.target.darwin-mips.mk
index 1bc1ffbdf7..1307cbb88c 100644
--- a/gpu/command_buffer_service.target.darwin-mips.mk
+++ b/gpu/command_buffer_service.target.darwin-mips.mk
@@ -119,6 +119,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -249,6 +250,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/command_buffer_service.target.darwin-x86.mk b/gpu/command_buffer_service.target.darwin-x86.mk
index 02d834e01a..2db4d55127 100644
--- a/gpu/command_buffer_service.target.darwin-x86.mk
+++ b/gpu/command_buffer_service.target.darwin-x86.mk
@@ -121,6 +121,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -252,6 +253,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/command_buffer_service.target.darwin-x86_64.mk b/gpu/command_buffer_service.target.darwin-x86_64.mk
index f083bfbe36..2eb7b8b13c 100644
--- a/gpu/command_buffer_service.target.darwin-x86_64.mk
+++ b/gpu/command_buffer_service.target.darwin-x86_64.mk
@@ -121,6 +121,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -252,6 +253,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/command_buffer_service.target.linux-arm.mk b/gpu/command_buffer_service.target.linux-arm.mk
index 3a6caf00a5..ce1dcd7510 100644
--- a/gpu/command_buffer_service.target.linux-arm.mk
+++ b/gpu/command_buffer_service.target.linux-arm.mk
@@ -120,6 +120,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -251,6 +252,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/command_buffer_service.target.linux-mips.mk b/gpu/command_buffer_service.target.linux-mips.mk
index 1bc1ffbdf7..1307cbb88c 100644
--- a/gpu/command_buffer_service.target.linux-mips.mk
+++ b/gpu/command_buffer_service.target.linux-mips.mk
@@ -119,6 +119,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -249,6 +250,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/command_buffer_service.target.linux-x86.mk b/gpu/command_buffer_service.target.linux-x86.mk
index 02d834e01a..2db4d55127 100644
--- a/gpu/command_buffer_service.target.linux-x86.mk
+++ b/gpu/command_buffer_service.target.linux-x86.mk
@@ -121,6 +121,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -252,6 +253,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/command_buffer_service.target.linux-x86_64.mk b/gpu/command_buffer_service.target.linux-x86_64.mk
index f083bfbe36..2eb7b8b13c 100644
--- a/gpu/command_buffer_service.target.linux-x86_64.mk
+++ b/gpu/command_buffer_service.target.linux-x86_64.mk
@@ -121,6 +121,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -252,6 +253,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/config/gpu_control_list.cc b/gpu/config/gpu_control_list.cc
index 2465007fbd..21088a1e99 100644
--- a/gpu/config/gpu_control_list.cc
+++ b/gpu/config/gpu_control_list.cc
@@ -86,28 +86,12 @@ int CompareLexicalNumberStrings(
return 0;
}
-bool GpuUnmatched(uint32 vendor_id, const std::vector<uint32>& device_id_list,
- const GPUInfo::GPUDevice& gpu) {
- if (vendor_id == 0)
- return false;
- if (vendor_id != gpu.vendor_id)
- return true;
- bool device_specified = false;
- for (size_t i = 0; i < device_id_list.size(); ++i) {
- if (device_id_list[i] == 0)
- continue;
- if (device_id_list[i] == gpu.device_id)
- return false;
- device_specified = true;
- }
- return device_specified;
-}
-
const char kMultiGpuStyleStringAMDSwitchable[] = "amd_switchable";
const char kMultiGpuStyleStringOptimus[] = "optimus";
const char kMultiGpuCategoryStringPrimary[] = "primary";
const char kMultiGpuCategoryStringSecondary[] = "secondary";
+const char kMultiGpuCategoryStringActive[] = "active";
const char kMultiGpuCategoryStringAny[] = "any";
const char kVersionStyleStringNumerical[] = "numerical";
@@ -844,13 +828,14 @@ bool GpuControlList::GpuControlListEntry::SetOsInfo(
bool GpuControlList::GpuControlListEntry::SetVendorId(
const std::string& vendor_id_string) {
vendor_id_ = 0;
- return base::HexStringToUInt(vendor_id_string, &vendor_id_);
+ return base::HexStringToUInt(vendor_id_string, &vendor_id_) &&
+ vendor_id_ != 0;
}
bool GpuControlList::GpuControlListEntry::AddDeviceId(
const std::string& device_id_string) {
uint32 device_id = 0;
- if (base::HexStringToUInt(device_id_string, &device_id)) {
+ if (base::HexStringToUInt(device_id_string, &device_id) && device_id != 0) {
device_id_list_.push_back(device_id);
return true;
}
@@ -1035,6 +1020,8 @@ GpuControlList::GpuControlListEntry::StringToMultiGpuCategory(
return kMultiGpuCategoryPrimary;
if (category == kMultiGpuCategoryStringSecondary)
return kMultiGpuCategorySecondary;
+ if (category == kMultiGpuCategoryStringActive)
+ return kMultiGpuCategoryActive;
if (category == kMultiGpuCategoryStringAny)
return kMultiGpuCategoryAny;
return kMultiGpuCategoryNone;
@@ -1054,28 +1041,54 @@ bool GpuControlList::GpuControlListEntry::Contains(
DCHECK(os_type != kOsAny);
if (os_info_.get() != NULL && !os_info_->Contains(os_type, os_version))
return false;
- bool is_not_primary_gpu =
- GpuUnmatched(vendor_id_, device_id_list_, gpu_info.gpu);
- bool is_not_secondary_gpu = true;
- for (size_t i = 0; i < gpu_info.secondary_gpus.size(); ++i) {
- is_not_secondary_gpu = is_not_secondary_gpu &&
- GpuUnmatched(vendor_id_, device_id_list_, gpu_info.secondary_gpus[i]);
- }
- switch (multi_gpu_category_) {
- case kMultiGpuCategoryPrimary:
- if (is_not_primary_gpu)
- return false;
- break;
- case kMultiGpuCategorySecondary:
- if (is_not_secondary_gpu)
- return false;
- break;
- case kMultiGpuCategoryAny:
- if (is_not_primary_gpu && is_not_secondary_gpu)
- return false;
- break;
- case kMultiGpuCategoryNone:
- break;
+ if (vendor_id_ != 0) {
+ std::vector<GPUInfo::GPUDevice> candidates;
+ switch (multi_gpu_category_) {
+ case kMultiGpuCategoryPrimary:
+ candidates.push_back(gpu_info.gpu);
+ break;
+ case kMultiGpuCategorySecondary:
+ candidates = gpu_info.secondary_gpus;
+ break;
+ case kMultiGpuCategoryAny:
+ candidates = gpu_info.secondary_gpus;
+ candidates.push_back(gpu_info.gpu);
+ break;
+ case kMultiGpuCategoryActive:
+ if (gpu_info.gpu.active)
+ candidates.push_back(gpu_info.gpu);
+ for (size_t ii = 0; ii < gpu_info.secondary_gpus.size(); ++ii) {
+ if (gpu_info.secondary_gpus[ii].active)
+ candidates.push_back(gpu_info.secondary_gpus[ii]);
+ }
+ default:
+ break;
+ }
+
+ GPUInfo::GPUDevice gpu;
+ gpu.vendor_id = vendor_id_;
+ bool found = false;
+ if (device_id_list_.empty()) {
+ for (size_t ii = 0; ii < candidates.size(); ++ii) {
+ if (gpu.vendor_id == candidates[ii].vendor_id) {
+ found = true;
+ break;
+ }
+ }
+ } else {
+ for (size_t ii = 0; ii < device_id_list_.size(); ++ii) {
+ gpu.device_id = device_id_list_[ii];
+ for (size_t jj = 0; jj < candidates.size(); ++jj) {
+ if (gpu.vendor_id == candidates[jj].vendor_id &&
+ gpu.device_id == candidates[jj].device_id) {
+ found = true;
+ break;
+ }
+ }
+ }
+ }
+ if (!found)
+ return false;
}
switch (multi_gpu_style_) {
case kMultiGpuStyleOptimus:
diff --git a/gpu/config/gpu_control_list.h b/gpu/config/gpu_control_list.h
index 80a95ba1a2..34d112b669 100644
--- a/gpu/config/gpu_control_list.h
+++ b/gpu/config/gpu_control_list.h
@@ -348,8 +348,13 @@ class GPU_EXPORT GpuControlList {
};
enum MultiGpuCategory {
+ // This entry applies if this is the primary GPU on the system.
kMultiGpuCategoryPrimary,
+ // This entry applies if this is a secondary GPU on the system.
kMultiGpuCategorySecondary,
+ // This entry applies if this is the active GPU on the system.
+ kMultiGpuCategoryActive,
+ // This entry applies if this is any of the GPUs on the system.
kMultiGpuCategoryAny,
kMultiGpuCategoryNone
};
diff --git a/gpu/config/gpu_control_list_entry_unittest.cc b/gpu/config/gpu_control_list_entry_unittest.cc
index 3c9d3855e6..b62be3e660 100644
--- a/gpu/config/gpu_control_list_entry_unittest.cc
+++ b/gpu/config/gpu_control_list_entry_unittest.cc
@@ -52,6 +52,7 @@ class GpuControlListEntryTest : public testing::Test {
virtual void SetUp() {
gpu_info_.gpu.vendor_id = 0x10de;
gpu_info_.gpu.device_id = 0x0640;
+ gpu_info_.gpu.active = true;
gpu_info_.driver_vendor = "NVIDIA";
gpu_info_.driver_version = "1.6.18";
gpu_info_.driver_date = "7-14-2009";
@@ -63,7 +64,7 @@ class GpuControlListEntryTest : public testing::Test {
gpu_info_.performance_stats.overall = 5.0;
}
- private:
+ protected:
GPUInfo gpu_info_;
};
@@ -584,72 +585,6 @@ TEST_F(GpuControlListEntryTest, LexicalDriverVersionEntry) {
GpuControlList::kOsLinux, "10.6", gpu_info));
}
-TEST_F(GpuControlListEntryTest, MultipleGPUsAnyEntry) {
- const std::string json = LONG_STRING_CONST(
- {
- "id": 1,
- "os": {
- "type": "macosx"
- },
- "vendor_id": "0x8086",
- "device_id": ["0x0166"],
- "multi_gpu_category": "any",
- "features": [
- "test_feature_0"
- ]
- }
- );
- ScopedEntry entry(GetEntryFromString(json));
- EXPECT_TRUE(entry.get() != NULL);
- EXPECT_EQ(GpuControlList::kOsMacosx, entry->GetOsType());
-
- GPUInfo gpu_info;
- gpu_info.gpu.vendor_id = 0x10de;
- gpu_info.gpu.device_id = 0x1976;
- EXPECT_FALSE(entry->Contains(
- GpuControlList::kOsMacosx, "10.6", gpu_info));
-
- GPUInfo::GPUDevice gpu_device;
- gpu_device.vendor_id = 0x8086;
- gpu_device.device_id = 0x0166;
- gpu_info.secondary_gpus.push_back(gpu_device);
- EXPECT_TRUE(entry->Contains(
- GpuControlList::kOsMacosx, "10.6", gpu_info));
-}
-
-TEST_F(GpuControlListEntryTest, MultipleGPUsSecondaryEntry) {
- const std::string json = LONG_STRING_CONST(
- {
- "id": 1,
- "os": {
- "type": "macosx"
- },
- "vendor_id": "0x8086",
- "device_id": ["0x0166"],
- "multi_gpu_category": "secondary",
- "features": [
- "test_feature_0"
- ]
- }
- );
- ScopedEntry entry(GetEntryFromString(json));
- EXPECT_TRUE(entry.get() != NULL);
- EXPECT_EQ(GpuControlList::kOsMacosx, entry->GetOsType());
-
- GPUInfo gpu_info;
- gpu_info.gpu.vendor_id = 0x10de;
- gpu_info.gpu.device_id = 0x1976;
- EXPECT_FALSE(entry->Contains(
- GpuControlList::kOsMacosx, "10.6", gpu_info));
-
- GPUInfo::GPUDevice gpu_device;
- gpu_device.vendor_id = 0x8086;
- gpu_device.device_id = 0x0166;
- gpu_info.secondary_gpus.push_back(gpu_device);
- EXPECT_TRUE(entry->Contains(
- GpuControlList::kOsMacosx, "10.6", gpu_info));
-}
-
TEST_F(GpuControlListEntryTest, NeedsMoreInfoEntry) {
const std::string json = LONG_STRING_CONST(
{
@@ -721,5 +656,266 @@ TEST_F(GpuControlListEntryTest, FeatureTypeAllEntry) {
EXPECT_EQ(1u, entry->features().count(TEST_FEATURE_2));
}
+TEST_F(GpuControlListEntryTest, InvalidVendorIdEntry) {
+ const std::string json = LONG_STRING_CONST(
+ {
+ "id": 1,
+ "vendor_id": "0x0000",
+ "features": [
+ "test_feature_1"
+ ]
+ }
+ );
+ ScopedEntry entry(GetEntryFromString(json));
+ EXPECT_TRUE(entry.get() == NULL);
+}
+
+TEST_F(GpuControlListEntryTest, InvalidDeviceIdEntry) {
+ const std::string json = LONG_STRING_CONST(
+ {
+ "id": 1,
+ "vendor_id": "0x10de",
+ "device_id": ["0x1023", "0x0000"],
+ "features": [
+ "test_feature_1"
+ ]
+ }
+ );
+ ScopedEntry entry(GetEntryFromString(json));
+ EXPECT_TRUE(entry.get() == NULL);
+}
+
+TEST_F(GpuControlListEntryTest, SingleActiveGPU) {
+ const std::string json = LONG_STRING_CONST(
+ {
+ "id": 1,
+ "os": {
+ "type": "macosx"
+ },
+ "vendor_id": "0x10de",
+ "device_id": ["0x0640"],
+ "multi_gpu_category": "active",
+ "features": [
+ "test_feature_0"
+ ]
+ }
+ );
+ ScopedEntry entry(GetEntryFromString(json));
+ EXPECT_TRUE(entry.get() != NULL);
+ EXPECT_EQ(GpuControlList::kOsMacosx, entry->GetOsType());
+ EXPECT_TRUE(entry->Contains(
+ GpuControlList::kOsMacosx, "10.6", gpu_info()));
+}
+
+class GpuControlListEntryDualGPUTest : public GpuControlListEntryTest {
+ public:
+ GpuControlListEntryDualGPUTest() { }
+ virtual ~GpuControlListEntryDualGPUTest() { }
+
+ virtual void SetUp() OVERRIDE {
+ // Set up a NVIDIA/Intel dual, with NVIDIA as primary and Intel as
+ // secondary, and initially Intel is active.
+ gpu_info_.gpu.vendor_id = 0x10de;
+ gpu_info_.gpu.device_id = 0x0640;
+ gpu_info_.gpu.active = false;
+ GPUInfo::GPUDevice second_gpu;
+ second_gpu.vendor_id = 0x8086;
+ second_gpu.device_id = 0x0166;
+ second_gpu.active = true;
+ gpu_info_.secondary_gpus.push_back(second_gpu);
+ }
+
+ void ActivatePrimaryGPU() {
+ gpu_info_.gpu.active = true;
+ gpu_info_.secondary_gpus[0].active = false;
+ }
+
+ void EntryShouldApply(const std::string& entry_json) const {
+ EXPECT_TRUE(EntryApplies(entry_json));
+ }
+
+ void EntryShouldNotApply(const std::string& entry_json) const {
+ EXPECT_FALSE(EntryApplies(entry_json));
+ }
+
+ private:
+ bool EntryApplies(const std::string& entry_json) const {
+ ScopedEntry entry(GetEntryFromString(entry_json));
+ EXPECT_TRUE(entry.get());
+ EXPECT_EQ(GpuControlList::kOsMacosx, entry->GetOsType());
+ return entry->Contains(GpuControlList::kOsMacosx, "10.6", gpu_info());
+ }
+};
+
+TEST_F(GpuControlListEntryDualGPUTest, CategoryAny) {
+ const std::string json_intel = LONG_STRING_CONST(
+ {
+ "id": 1,
+ "os": {
+ "type": "macosx"
+ },
+ "vendor_id": "0x8086",
+ "device_id": ["0x0166"],
+ "multi_gpu_category": "any",
+ "features": [
+ "test_feature_0"
+ ]
+ }
+ );
+ EntryShouldApply(json_intel);
+
+ const std::string json_nvidia = LONG_STRING_CONST(
+ {
+ "id": 1,
+ "os": {
+ "type": "macosx"
+ },
+ "vendor_id": "0x10de",
+ "device_id": ["0x0640"],
+ "multi_gpu_category": "any",
+ "features": [
+ "test_feature_0"
+ ]
+ }
+ );
+ EntryShouldApply(json_nvidia);
+}
+
+TEST_F(GpuControlListEntryDualGPUTest, CategoryPrimarySecondary) {
+ const std::string json_secondary = LONG_STRING_CONST(
+ {
+ "id": 1,
+ "os": {
+ "type": "macosx"
+ },
+ "vendor_id": "0x8086",
+ "device_id": ["0x0166"],
+ "multi_gpu_category": "secondary",
+ "features": [
+ "test_feature_0"
+ ]
+ }
+ );
+ EntryShouldApply(json_secondary);
+
+ const std::string json_primary = LONG_STRING_CONST(
+ {
+ "id": 1,
+ "os": {
+ "type": "macosx"
+ },
+ "vendor_id": "0x8086",
+ "device_id": ["0x0166"],
+ "multi_gpu_category": "primary",
+ "features": [
+ "test_feature_0"
+ ]
+ }
+ );
+ EntryShouldNotApply(json_primary);
+
+ const std::string json_default = LONG_STRING_CONST(
+ {
+ "id": 1,
+ "os": {
+ "type": "macosx"
+ },
+ "vendor_id": "0x8086",
+ "device_id": ["0x0166"],
+ "features": [
+ "test_feature_0"
+ ]
+ }
+ );
+ // Default is primary.
+ EntryShouldNotApply(json_default);
+}
+
+TEST_F(GpuControlListEntryDualGPUTest, ActiveSecondaryGPU) {
+ const std::string json = LONG_STRING_CONST(
+ {
+ "id": 1,
+ "os": {
+ "type": "macosx"
+ },
+ "vendor_id": "0x8086",
+ "device_id": ["0x0166", "0x0168"],
+ "multi_gpu_category": "active",
+ "features": [
+ "test_feature_0"
+ ]
+ }
+ );
+ // By default, secondary GPU is active.
+ EntryShouldApply(json);
+
+ ActivatePrimaryGPU();
+ EntryShouldNotApply(json);
+}
+
+TEST_F(GpuControlListEntryDualGPUTest, VendorOnlyActiveSecondaryGPU) {
+ const std::string json = LONG_STRING_CONST(
+ {
+ "id": 1,
+ "os": {
+ "type": "macosx"
+ },
+ "vendor_id": "0x8086",
+ "multi_gpu_category": "active",
+ "features": [
+ "test_feature_0"
+ ]
+ }
+ );
+ // By default, secondary GPU is active.
+ EntryShouldApply(json);
+
+ ActivatePrimaryGPU();
+ EntryShouldNotApply(json);
+}
+
+TEST_F(GpuControlListEntryDualGPUTest, ActivePrimaryGPU) {
+ const std::string json = LONG_STRING_CONST(
+ {
+ "id": 1,
+ "os": {
+ "type": "macosx"
+ },
+ "vendor_id": "0x10de",
+ "device_id": ["0x0640"],
+ "multi_gpu_category": "active",
+ "features": [
+ "test_feature_0"
+ ]
+ }
+ );
+ // By default, secondary GPU is active.
+ EntryShouldNotApply(json);
+
+ ActivatePrimaryGPU();
+ EntryShouldApply(json);
+}
+
+TEST_F(GpuControlListEntryDualGPUTest, VendorOnlyActivePrimaryGPU) {
+ const std::string json = LONG_STRING_CONST(
+ {
+ "id": 1,
+ "os": {
+ "type": "macosx"
+ },
+ "vendor_id": "0x10de",
+ "multi_gpu_category": "active",
+ "features": [
+ "test_feature_0"
+ ]
+ }
+ );
+ // By default, secondary GPU is active.
+ EntryShouldNotApply(json);
+
+ ActivatePrimaryGPU();
+ EntryShouldApply(json);
+}
+
} // namespace gpu
diff --git a/gpu/config/gpu_control_list_format.txt b/gpu/config/gpu_control_list_format.txt
index 482a8b1e09..40936b90fa 100644
--- a/gpu/config/gpu_control_list_format.txt
+++ b/gpu/config/gpu_control_list_format.txt
@@ -26,7 +26,8 @@
// 5. "multi_gpu_style" is a string, valid values include "optimus", and
// "amd_switchable".
// 6. "multi_gpu_category" is a string, valid values include "any", "primary",
-// and "secondary". If unspecified, the default value is "primary".
+// "secondary", and "active". If unspecified, the default value is "primary".
+// See gpu_control_list.h for more details on the meanings of the strings.
// 7. "driver_vendor" is a STRING structure (defined below).
// 8. "driver_version" is a VERSION structure (defined below).
// 9. "driver_date" is a VERSION structure (defined below).
diff --git a/gpu/config/gpu_driver_bug_list.cc b/gpu/config/gpu_driver_bug_list.cc
index 9cea41a1d0..a091c4218f 100644
--- a/gpu/config/gpu_driver_bug_list.cc
+++ b/gpu/config/gpu_driver_bug_list.cc
@@ -12,7 +12,12 @@ namespace gpu {
namespace {
-const DriverBugInfo kFeatureList[] = {
+struct GpuDriverBugWorkaroundInfo {
+ GpuDriverBugWorkaroundType type;
+ const char* name;
+};
+
+const GpuDriverBugWorkaroundInfo kFeatureList[] = {
#define GPU_OP(type, name) { type, #name },
GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP)
#undef GPU_OP
@@ -34,8 +39,8 @@ GpuDriverBugList* GpuDriverBugList::Create() {
DCHECK_EQ(static_cast<int>(arraysize(kFeatureList)),
NUMBER_OF_GPU_DRIVER_BUG_WORKAROUND_TYPES);
for (int i = 0; i < NUMBER_OF_GPU_DRIVER_BUG_WORKAROUND_TYPES; ++i) {
- list->AddSupportedFeature(kFeatureList[i].feature_name,
- kFeatureList[i].feature_type);
+ list->AddSupportedFeature(kFeatureList[i].name,
+ kFeatureList[i].type);
}
return list;
}
@@ -43,13 +48,41 @@ GpuDriverBugList* GpuDriverBugList::Create() {
std::string GpuDriverBugWorkaroundTypeToString(
GpuDriverBugWorkaroundType type) {
if (type < NUMBER_OF_GPU_DRIVER_BUG_WORKAROUND_TYPES)
- return kFeatureList[type].feature_name;
+ return kFeatureList[type].name;
else
return "unknown";
}
-const struct DriverBugInfo* GetDriverBugWorkarounds() {
- return kFeatureList;
+// static
+void GpuDriverBugList::AppendWorkaroundsFromCommandLine(
+ std::set<int>* workarounds, const CommandLine& command_line) {
+ DCHECK(workarounds);
+ for (int i = 0; i < NUMBER_OF_GPU_DRIVER_BUG_WORKAROUND_TYPES; i++) {
+ if (!command_line.HasSwitch(kFeatureList[i].name))
+ continue;
+ // Removing conflicting workarounds.
+ switch (kFeatureList[i].type) {
+ case FORCE_DISCRETE_GPU:
+ workarounds->erase(FORCE_INTEGRATED_GPU);
+ workarounds->insert(FORCE_DISCRETE_GPU);
+ break;
+ case FORCE_INTEGRATED_GPU:
+ workarounds->erase(FORCE_DISCRETE_GPU);
+ workarounds->insert(FORCE_INTEGRATED_GPU);
+ break;
+ case MAX_CUBE_MAP_TEXTURE_SIZE_LIMIT_512:
+ case MAX_CUBE_MAP_TEXTURE_SIZE_LIMIT_1024:
+ case MAX_CUBE_MAP_TEXTURE_SIZE_LIMIT_4096:
+ workarounds->erase(MAX_CUBE_MAP_TEXTURE_SIZE_LIMIT_512);
+ workarounds->erase(MAX_CUBE_MAP_TEXTURE_SIZE_LIMIT_1024);
+ workarounds->erase(MAX_CUBE_MAP_TEXTURE_SIZE_LIMIT_4096);
+ workarounds->insert(kFeatureList[i].type);
+ break;
+ default:
+ workarounds->insert(kFeatureList[i].type);
+ break;
+ }
+ }
}
} // namespace gpu
diff --git a/gpu/config/gpu_driver_bug_list.h b/gpu/config/gpu_driver_bug_list.h
index 833ff564b8..a4bd3bb02b 100644
--- a/gpu/config/gpu_driver_bug_list.h
+++ b/gpu/config/gpu_driver_bug_list.h
@@ -5,8 +5,10 @@
#ifndef GPU_CONFIG_GPU_DRIVER_BUG_LIST_H_
#define GPU_CONFIG_GPU_DRIVER_BUG_LIST_H_
+#include <set>
#include <string>
+#include "base/command_line.h"
#include "gpu/config/gpu_control_list.h"
#include "gpu/config/gpu_driver_bug_workaround_type.h"
#include "gpu/gpu_export.h"
@@ -19,19 +21,17 @@ class GPU_EXPORT GpuDriverBugList : public GpuControlList {
static GpuDriverBugList* Create();
+ // Append |workarounds| with these passed in through the
+ // |command_line|.
+ static void AppendWorkaroundsFromCommandLine(
+ std::set<int>* workarounds, const CommandLine& command_line);
+
private:
GpuDriverBugList();
DISALLOW_COPY_AND_ASSIGN(GpuDriverBugList);
};
-struct DriverBugInfo {
- GpuDriverBugWorkaroundType feature_type;
- const char* feature_name;
-};
-
-const struct DriverBugInfo* GetDriverBugWorkarounds();
-
} // namespace gpu
#endif // GPU_CONFIG_GPU_DRIVER_BUG_LIST_H_
diff --git a/gpu/config/gpu_driver_bug_list_json.cc b/gpu/config/gpu_driver_bug_list_json.cc
index 08febf0075..aee1325d83 100644
--- a/gpu/config/gpu_driver_bug_list_json.cc
+++ b/gpu/config/gpu_driver_bug_list_json.cc
@@ -19,7 +19,7 @@ const char kGpuDriverBugListJson[] = LONG_STRING_CONST(
{
"name": "gpu driver bug list",
// Please update the version number whenever you change this file.
- "version": "4.8",
+ "version": "4.10",
"entries": [
{
"id": 1,
@@ -356,7 +356,7 @@ const char kGpuDriverBugListJson[] = LONG_STRING_CONST(
{
"id": 25,
"cr_bugs": [152225],
- "description": "PBO + Readpixels don't work on Intel GPUs on OS X 10.7",
+ "description": "PBO + Readpixels don't work on OS X 10.7",
"os": {
"type": "macosx",
"version": {
@@ -364,7 +364,6 @@ const char kGpuDriverBugListJson[] = LONG_STRING_CONST(
"value": "10.8"
}
},
- "vendor_id": "0x8086",
"features": [
"disable_async_readpixels"
]
@@ -877,7 +876,7 @@ const char kGpuDriverBugListJson[] = LONG_STRING_CONST(
},
{
"id": 66,
- "description": "Force glFinish() after compositing on older OS X",
+ "description": "Force glFinish() after compositing on older OS X on Intel GPU",
"cr_bugs": [123409],
"os": {
"type": "macosx",
@@ -887,14 +886,14 @@ const char kGpuDriverBugListJson[] = LONG_STRING_CONST(
}
},
"vendor_id": "0x8086",
- "multi_gpu_category": "any",
+ "multi_gpu_category": "active",
"features": [
"force_gl_finish_after_compositing"
]
},
{
"id": 67,
- "description": "Force glFinish() after compositing on Mavericks with Retina MacBook Pro",
+ "description": "Force glFinish() after compositing on Mavericks on Intel GPU",
// TODO(ccameron): Get rid of this when we move to CoreAnimation.
"cr_bugs": [318877],
"os": {
@@ -904,7 +903,8 @@ const char kGpuDriverBugListJson[] = LONG_STRING_CONST(
"value": "10.9"
}
},
- "multi_gpu_style": "optimus",
+ "vendor_id": "0x8086",
+ "multi_gpu_category": "active",
"features": [
"force_gl_finish_after_compositing"
]
diff --git a/gpu/config/gpu_driver_bug_list_unittest.cc b/gpu/config/gpu_driver_bug_list_unittest.cc
index 1a5590c556..798cdbba7e 100644
--- a/gpu/config/gpu_driver_bug_list_unittest.cc
+++ b/gpu/config/gpu_driver_bug_list_unittest.cc
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/command_line.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "gpu/config/gpu_control_list_jsons.h"
@@ -125,5 +126,35 @@ TEST_F(GpuDriverBugListTest, GpuSwitching) {
EXPECT_EQ(2u, entries[0]);
}
+TEST_F(GpuDriverBugListTest, AppendSingleWorkaround) {
+ base::CommandLine command_line(0, NULL);
+ command_line.AppendSwitch(
+ GpuDriverBugWorkaroundTypeToString(DISABLE_MULTISAMPLING));
+ std::set<int> workarounds;
+ workarounds.insert(EXIT_ON_CONTEXT_LOST);
+ workarounds.insert(INIT_VERTEX_ATTRIBUTES);
+ EXPECT_EQ(2u, workarounds.size());
+ GpuDriverBugList::AppendWorkaroundsFromCommandLine(
+ &workarounds, command_line);
+ EXPECT_EQ(3u, workarounds.size());
+ EXPECT_EQ(1u, workarounds.count(DISABLE_MULTISAMPLING));
+}
+
+TEST_F(GpuDriverBugListTest, AppendForceGPUWorkaround) {
+ base::CommandLine command_line(0, NULL);
+ command_line.AppendSwitch(
+ GpuDriverBugWorkaroundTypeToString(FORCE_DISCRETE_GPU));
+ std::set<int> workarounds;
+ workarounds.insert(EXIT_ON_CONTEXT_LOST);
+ workarounds.insert(FORCE_INTEGRATED_GPU);
+ EXPECT_EQ(2u, workarounds.size());
+ EXPECT_EQ(1u, workarounds.count(FORCE_INTEGRATED_GPU));
+ GpuDriverBugList::AppendWorkaroundsFromCommandLine(
+ &workarounds, command_line);
+ EXPECT_EQ(2u, workarounds.size());
+ EXPECT_EQ(0u, workarounds.count(FORCE_INTEGRATED_GPU));
+ EXPECT_EQ(1u, workarounds.count(FORCE_DISCRETE_GPU));
+}
+
} // namespace gpu
diff --git a/gpu/config/gpu_info.cc b/gpu/config/gpu_info.cc
index bb26147fbe..0b5c4870ea 100644
--- a/gpu/config/gpu_info.cc
+++ b/gpu/config/gpu_info.cc
@@ -11,6 +11,7 @@ void EnumerateGPUDevice(gpu::GPUInfo::Enumerator* enumerator,
enumerator->BeginGPUDevice();
enumerator->AddInt("vendorId", device.vendor_id);
enumerator->AddInt("deviceId", device.device_id);
+ enumerator->AddBool("active", device.active);
enumerator->AddString("vendorString", device.vendor_string);
enumerator->AddString("deviceString", device.device_string);
enumerator->EndGPUDevice();
@@ -22,7 +23,8 @@ namespace gpu {
GPUInfo::GPUDevice::GPUDevice()
: vendor_id(0),
- device_id(0) {
+ device_id(0),
+ active(false) {
}
GPUInfo::GPUDevice::~GPUDevice() { }
diff --git a/gpu/config/gpu_info.h b/gpu/config/gpu_info.h
index 3828b44be4..ee4a8b3b24 100644
--- a/gpu/config/gpu_info.h
+++ b/gpu/config/gpu_info.h
@@ -33,6 +33,10 @@ struct GPU_EXPORT GPUInfo {
// Device ids are unique to vendor, not to one another.
uint32 device_id;
+ // Whether this GPU is the currently used one.
+ // Currently this field is only supported and meaningful on OS X.
+ bool active;
+
// The strings that describe the GPU.
// In Linux these strings are obtained through libpci.
// In Win/MacOSX, these two strings are not filled at the moment.
diff --git a/gpu/config/gpu_info_collector_mac.mm b/gpu/config/gpu_info_collector_mac.mm
index 547f6a8717..ec6a31d49c 100644
--- a/gpu/config/gpu_info_collector_mac.mm
+++ b/gpu/config/gpu_info_collector_mac.mm
@@ -64,6 +64,7 @@ GPUInfo::GPUDevice GetActiveGPU() {
// Scan IO registry for PCI video cards.
bool CollectPCIVideoCardInfo(GPUInfo* gpu_info) {
DCHECK(gpu_info);
+ GPUInfo::GPUDevice active_gpu = GetActiveGPU();
// Collect all GPUs' info.
// match_dictionary will be consumed by IOServiceGetMatchingServices, no need
@@ -83,8 +84,13 @@ bool CollectPCIVideoCardInfo(GPUInfo* gpu_info) {
}
gpu.vendor_id = GetEntryProperty(entry, CFSTR("vendor-id"));
gpu.device_id = GetEntryProperty(entry, CFSTR("device-id"));
- if (gpu.vendor_id && gpu.device_id)
+ if (gpu.vendor_id && gpu.device_id) {
+ if (gpu.vendor_id == active_gpu.vendor_id &&
+ gpu.device_id == active_gpu.device_id) {
+ gpu.active = true;
+ }
gpu_list.push_back(gpu);
+ }
}
IOObjectRelease(entry_iterator);
}
@@ -128,15 +134,11 @@ bool CollectPCIVideoCardInfo(GPUInfo* gpu_info) {
}
default:
{
- GPUInfo::GPUDevice active_gpu = GetActiveGPU();
size_t current = gpu_list.size();
- if (active_gpu.vendor_id && active_gpu.device_id) {
- for (size_t i = 0; i < gpu_list.size(); ++i) {
- if (gpu_list[i].vendor_id == active_gpu.vendor_id &&
- gpu_list[i].device_id == active_gpu.device_id) {
- current = i;
- break;
- }
+ for (size_t i = 0; i < gpu_list.size(); ++i) {
+ if (gpu_list[i].active) {
+ current = i;
+ break;
}
}
if (current == gpu_list.size()) {
@@ -170,15 +172,13 @@ CollectInfoResult CollectContextGraphicsInfo(GPUInfo* gpu_info) {
GpuIDResult CollectGpuID(uint32* vendor_id, uint32* device_id) {
DCHECK(vendor_id && device_id);
- *vendor_id = 0;
- *device_id = 0;
- GPUInfo gpu_info;
- if (CollectPCIVideoCardInfo(&gpu_info)) {
- *vendor_id = gpu_info.gpu.vendor_id;
- *device_id = gpu_info.gpu.device_id;
+ GPUInfo::GPUDevice gpu = GetActiveGPU();
+ *vendor_id = gpu.vendor_id;
+ *device_id = gpu.device_id;
+
+ if (*vendor_id != 0 && *device_id != 0)
return kGpuIDSuccess;
- }
return kGpuIDFailure;
}
diff --git a/gpu/config/gpu_util.cc b/gpu/config/gpu_util.cc
index 9c868e14af..4605981cfb 100644
--- a/gpu/config/gpu_util.cc
+++ b/gpu/config/gpu_util.cc
@@ -65,11 +65,10 @@ void ApplyGpuDriverBugWorkarounds(
scoped_ptr<GpuDriverBugList> list(GpuDriverBugList::Create());
list->LoadList(kGpuDriverBugListJson,
GpuControlList::kCurrentOsOnly);
- std::set<int> workarounds = WorkaroundsFromCommandLine(command_line);
- if (workarounds.empty()) {
- workarounds = list->MakeDecision(
- GpuControlList::kOsAny, std::string(), gpu_info);
- }
+ std::set<int> workarounds = list->MakeDecision(
+ GpuControlList::kOsAny, std::string(), gpu_info);
+ GpuDriverBugList::AppendWorkaroundsFromCommandLine(
+ &workarounds, *command_line);
if (!workarounds.empty()) {
command_line->AppendSwitchASCII(switches::kGpuDriverBugWorkarounds,
IntSetToString(workarounds));
@@ -81,16 +80,4 @@ void StringToFeatureSet(
StringToIntSet(str, feature_set);
}
-std::set<int> WorkaroundsFromCommandLine(CommandLine* command_line) {
- std::set<int> workarounds;
- const struct DriverBugInfo* kFeatureList = GetDriverBugWorkarounds();
-
- for (int i = 0; i < NUMBER_OF_GPU_DRIVER_BUG_WORKAROUND_TYPES; i++) {
- if (command_line->HasSwitch(kFeatureList[i].feature_name))
- workarounds.insert(kFeatureList[i].feature_type);
- }
-
- return workarounds;
-}
-
} // namespace gpu
diff --git a/gpu/config/gpu_util.h b/gpu/config/gpu_util.h
index e5735a0f77..21c802cbbb 100644
--- a/gpu/config/gpu_util.h
+++ b/gpu/config/gpu_util.h
@@ -37,10 +37,6 @@ GPU_EXPORT void ApplyGpuDriverBugWorkarounds(
GPU_EXPORT void StringToFeatureSet(
const std::string& str, std::set<int>* feature_set);
-// Get the set of workarounds from switches provided in |command_line|
-GPU_EXPORT std::set<int> WorkaroundsFromCommandLine(
- base::CommandLine* command_line);
-
} // namespace gpu
#endif // GPU_CONFIG_GPU_UTIL_H_
diff --git a/gpu/config/software_rendering_list_json.cc b/gpu/config/software_rendering_list_json.cc
index 86f26306f5..23c8ac0454 100644
--- a/gpu/config/software_rendering_list_json.cc
+++ b/gpu/config/software_rendering_list_json.cc
@@ -18,7 +18,7 @@ const char kSoftwareRenderingListJson[] = LONG_STRING_CONST(
{
"name": "software rendering list",
// Please update the version number whenever you change this file.
- "version": "7.3",
+ "version": "7.5",
"entries": [
{
"id": 1,
@@ -68,8 +68,8 @@ const char kSoftwareRenderingListJson[] = LONG_STRING_CONST(
},
{
"id": 5,
- "description": "ATI/AMD cards with older or third-party drivers in Linux are crash-prone",
- "cr_bugs": [71381, 76428, 73910, 101225, 136240],
+ "description": "ATI/AMD cards with older drivers in Linux are crash-prone",
+ "cr_bugs": [71381, 76428, 73910, 101225, 136240, 357314],
"os": {
"type": "linux"
},
@@ -85,6 +85,16 @@ const char kSoftwareRenderingListJson[] = LONG_STRING_CONST(
"style": "lexical",
"value": "8.98"
}
+ },
+ {
+ "driver_vendor": {
+ "op": "=",
+ "value": "Mesa"
+ },
+ "driver_version": {
+ "op": ">=",
+ "value": "10.0.4"
+ }
}
],
"features": [
@@ -153,7 +163,7 @@ const char kSoftwareRenderingListJson[] = LONG_STRING_CONST(
{
"id": 17,
"description": "Intel mesa drivers are crash-prone",
- "cr_bugs": [76703, 164555, 225200],
+ "cr_bugs": [76703, 164555, 225200, 340886],
"os": {
"type": "linux"
},
@@ -186,6 +196,13 @@ const char kSoftwareRenderingListJson[] = LONG_STRING_CONST(
"op": ">=",
"value": "9.1"
}
+ },
+ {
+ "device_id": ["0x0a16"],
+ "driver_version": {
+ "op": ">=",
+ "value": "10.0.1"
+ }
}
],
"features": [
@@ -244,7 +261,7 @@ const char kSoftwareRenderingListJson[] = LONG_STRING_CONST(
{
"id": 27,
"description": "ATI/AMD cards with older drivers in Linux are crash-prone",
- "cr_bugs": [95934, 94973, 136240],
+ "cr_bugs": [95934, 94973, 136240, 357314],
"os": {
"type": "linux"
},
@@ -263,6 +280,16 @@ const char kSoftwareRenderingListJson[] = LONG_STRING_CONST(
"style": "lexical",
"value": "8.98"
}
+ },
+ {
+ "driver_vendor": {
+ "op": "=",
+ "value": "Mesa"
+ },
+ "driver_version": {
+ "op": ">=",
+ "value": "10.0.4"
+ }
}
],
"features": [
@@ -272,7 +299,7 @@ const char kSoftwareRenderingListJson[] = LONG_STRING_CONST(
{
"id": 28,
"description": "ATI/AMD cards with third-party drivers in Linux are crash-prone",
- "cr_bugs": [95934, 94973],
+ "cr_bugs": [95934, 94973, 357314],
"os": {
"type": "linux"
},
@@ -284,6 +311,18 @@ const char kSoftwareRenderingListJson[] = LONG_STRING_CONST(
"op": "contains",
"value": "AMD"
},
+ "exceptions": [
+ {
+ "driver_vendor": {
+ "op": "=",
+ "value": "Mesa"
+ },
+ "driver_version": {
+ "op": ">=",
+ "value": "10.0.4"
+ }
+ }
+ ],
"features": [
"all"
]
@@ -291,7 +330,7 @@ const char kSoftwareRenderingListJson[] = LONG_STRING_CONST(
{
"id": 29,
"description": "ATI/AMD cards with third-party drivers in Linux are crash-prone",
- "cr_bugs": [95934, 94973],
+ "cr_bugs": [95934, 94973, 357314],
"os": {
"type": "linux"
},
@@ -303,6 +342,18 @@ const char kSoftwareRenderingListJson[] = LONG_STRING_CONST(
"op": "contains",
"value": "ATI"
},
+ "exceptions": [
+ {
+ "driver_vendor": {
+ "op": "=",
+ "value": "Mesa"
+ },
+ "driver_version": {
+ "op": ">=",
+ "value": "10.0.4"
+ }
+ }
+ ],
"features": [
"all"
]
diff --git a/gpu/disk_cache_proto.target.darwin-arm.mk b/gpu/disk_cache_proto.target.darwin-arm.mk
index d28e7fec33..8120696567 100644
--- a/gpu/disk_cache_proto.target.darwin-arm.mk
+++ b/gpu/disk_cache_proto.target.darwin-arm.mk
@@ -96,6 +96,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -186,6 +187,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/disk_cache_proto.target.darwin-mips.mk b/gpu/disk_cache_proto.target.darwin-mips.mk
index 615d1b9a09..20b25fa925 100644
--- a/gpu/disk_cache_proto.target.darwin-mips.mk
+++ b/gpu/disk_cache_proto.target.darwin-mips.mk
@@ -95,6 +95,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -184,6 +185,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/disk_cache_proto.target.darwin-x86.mk b/gpu/disk_cache_proto.target.darwin-x86.mk
index a181616679..39880bf925 100644
--- a/gpu/disk_cache_proto.target.darwin-x86.mk
+++ b/gpu/disk_cache_proto.target.darwin-x86.mk
@@ -97,6 +97,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -187,6 +188,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/disk_cache_proto.target.darwin-x86_64.mk b/gpu/disk_cache_proto.target.darwin-x86_64.mk
index 84bc0a3e78..c051da042d 100644
--- a/gpu/disk_cache_proto.target.darwin-x86_64.mk
+++ b/gpu/disk_cache_proto.target.darwin-x86_64.mk
@@ -97,6 +97,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -187,6 +188,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/disk_cache_proto.target.linux-arm.mk b/gpu/disk_cache_proto.target.linux-arm.mk
index d28e7fec33..8120696567 100644
--- a/gpu/disk_cache_proto.target.linux-arm.mk
+++ b/gpu/disk_cache_proto.target.linux-arm.mk
@@ -96,6 +96,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -186,6 +187,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/disk_cache_proto.target.linux-mips.mk b/gpu/disk_cache_proto.target.linux-mips.mk
index 615d1b9a09..20b25fa925 100644
--- a/gpu/disk_cache_proto.target.linux-mips.mk
+++ b/gpu/disk_cache_proto.target.linux-mips.mk
@@ -95,6 +95,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -184,6 +185,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/disk_cache_proto.target.linux-x86.mk b/gpu/disk_cache_proto.target.linux-x86.mk
index a181616679..39880bf925 100644
--- a/gpu/disk_cache_proto.target.linux-x86.mk
+++ b/gpu/disk_cache_proto.target.linux-x86.mk
@@ -97,6 +97,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -187,6 +188,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/disk_cache_proto.target.linux-x86_64.mk b/gpu/disk_cache_proto.target.linux-x86_64.mk
index 84bc0a3e78..c051da042d 100644
--- a/gpu/disk_cache_proto.target.linux-x86_64.mk
+++ b/gpu/disk_cache_proto.target.linux-x86_64.mk
@@ -97,6 +97,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -187,6 +188,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/gles2_c_lib.target.darwin-arm.mk b/gpu/gles2_c_lib.target.darwin-arm.mk
index d24df6e46a..17c1ac8808 100644
--- a/gpu/gles2_c_lib.target.darwin-arm.mk
+++ b/gpu/gles2_c_lib.target.darwin-arm.mk
@@ -70,6 +70,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -161,6 +162,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/gles2_c_lib.target.darwin-mips.mk b/gpu/gles2_c_lib.target.darwin-mips.mk
index afc5eac0f5..f15fcd7d37 100644
--- a/gpu/gles2_c_lib.target.darwin-mips.mk
+++ b/gpu/gles2_c_lib.target.darwin-mips.mk
@@ -69,6 +69,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -159,6 +160,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/gles2_c_lib.target.darwin-x86.mk b/gpu/gles2_c_lib.target.darwin-x86.mk
index 51b77a05d0..cbb4d8f6ee 100644
--- a/gpu/gles2_c_lib.target.darwin-x86.mk
+++ b/gpu/gles2_c_lib.target.darwin-x86.mk
@@ -71,6 +71,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -162,6 +163,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/gles2_c_lib.target.darwin-x86_64.mk b/gpu/gles2_c_lib.target.darwin-x86_64.mk
index 0a31fd919c..fa72f4b882 100644
--- a/gpu/gles2_c_lib.target.darwin-x86_64.mk
+++ b/gpu/gles2_c_lib.target.darwin-x86_64.mk
@@ -71,6 +71,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -162,6 +163,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/gles2_c_lib.target.linux-arm.mk b/gpu/gles2_c_lib.target.linux-arm.mk
index d24df6e46a..17c1ac8808 100644
--- a/gpu/gles2_c_lib.target.linux-arm.mk
+++ b/gpu/gles2_c_lib.target.linux-arm.mk
@@ -70,6 +70,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -161,6 +162,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/gles2_c_lib.target.linux-mips.mk b/gpu/gles2_c_lib.target.linux-mips.mk
index afc5eac0f5..f15fcd7d37 100644
--- a/gpu/gles2_c_lib.target.linux-mips.mk
+++ b/gpu/gles2_c_lib.target.linux-mips.mk
@@ -69,6 +69,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -159,6 +160,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/gles2_c_lib.target.linux-x86.mk b/gpu/gles2_c_lib.target.linux-x86.mk
index 51b77a05d0..cbb4d8f6ee 100644
--- a/gpu/gles2_c_lib.target.linux-x86.mk
+++ b/gpu/gles2_c_lib.target.linux-x86.mk
@@ -71,6 +71,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -162,6 +163,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/gles2_c_lib.target.linux-x86_64.mk b/gpu/gles2_c_lib.target.linux-x86_64.mk
index 0a31fd919c..fa72f4b882 100644
--- a/gpu/gles2_c_lib.target.linux-x86_64.mk
+++ b/gpu/gles2_c_lib.target.linux-x86_64.mk
@@ -71,6 +71,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -162,6 +163,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/gles2_cmd_helper.target.darwin-arm.mk b/gpu/gles2_cmd_helper.target.darwin-arm.mk
index e339809b70..e55858cfb9 100644
--- a/gpu/gles2_cmd_helper.target.darwin-arm.mk
+++ b/gpu/gles2_cmd_helper.target.darwin-arm.mk
@@ -69,6 +69,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -156,6 +157,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/gles2_cmd_helper.target.darwin-mips.mk b/gpu/gles2_cmd_helper.target.darwin-mips.mk
index c48b0442a4..2569ada36f 100644
--- a/gpu/gles2_cmd_helper.target.darwin-mips.mk
+++ b/gpu/gles2_cmd_helper.target.darwin-mips.mk
@@ -68,6 +68,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -154,6 +155,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/gles2_cmd_helper.target.darwin-x86.mk b/gpu/gles2_cmd_helper.target.darwin-x86.mk
index ad0dc05d9c..ae0a657636 100644
--- a/gpu/gles2_cmd_helper.target.darwin-x86.mk
+++ b/gpu/gles2_cmd_helper.target.darwin-x86.mk
@@ -70,6 +70,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -157,6 +158,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/gles2_cmd_helper.target.darwin-x86_64.mk b/gpu/gles2_cmd_helper.target.darwin-x86_64.mk
index 3c6fe2b620..b4de19453e 100644
--- a/gpu/gles2_cmd_helper.target.darwin-x86_64.mk
+++ b/gpu/gles2_cmd_helper.target.darwin-x86_64.mk
@@ -70,6 +70,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -157,6 +158,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/gles2_cmd_helper.target.linux-arm.mk b/gpu/gles2_cmd_helper.target.linux-arm.mk
index e339809b70..e55858cfb9 100644
--- a/gpu/gles2_cmd_helper.target.linux-arm.mk
+++ b/gpu/gles2_cmd_helper.target.linux-arm.mk
@@ -69,6 +69,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -156,6 +157,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/gles2_cmd_helper.target.linux-mips.mk b/gpu/gles2_cmd_helper.target.linux-mips.mk
index c48b0442a4..2569ada36f 100644
--- a/gpu/gles2_cmd_helper.target.linux-mips.mk
+++ b/gpu/gles2_cmd_helper.target.linux-mips.mk
@@ -68,6 +68,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -154,6 +155,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/gles2_cmd_helper.target.linux-x86.mk b/gpu/gles2_cmd_helper.target.linux-x86.mk
index ad0dc05d9c..ae0a657636 100644
--- a/gpu/gles2_cmd_helper.target.linux-x86.mk
+++ b/gpu/gles2_cmd_helper.target.linux-x86.mk
@@ -70,6 +70,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -157,6 +158,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/gles2_cmd_helper.target.linux-x86_64.mk b/gpu/gles2_cmd_helper.target.linux-x86_64.mk
index 3c6fe2b620..b4de19453e 100644
--- a/gpu/gles2_cmd_helper.target.linux-x86_64.mk
+++ b/gpu/gles2_cmd_helper.target.linux-x86_64.mk
@@ -70,6 +70,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -157,6 +158,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/gles2_conform_support/egl/display.cc b/gpu/gles2_conform_support/egl/display.cc
index 9885cd6928..8b43dffe8b 100644
--- a/gpu/gles2_conform_support/egl/display.cc
+++ b/gpu/gles2_conform_support/egl/display.cc
@@ -229,13 +229,15 @@ EGLContext Display::CreateContext(EGLConfig config,
DCHECK(transfer_buffer_.get());
bool bind_generates_resources = true;
-
- context_.reset(new gpu::gles2::GLES2Implementation(
- gles2_cmd_helper_.get(),
- NULL,
- transfer_buffer_.get(),
- bind_generates_resources,
- gpu_control_.get()));
+ bool lose_context_when_out_of_memory = false;
+
+ context_.reset(
+ new gpu::gles2::GLES2Implementation(gles2_cmd_helper_.get(),
+ NULL,
+ transfer_buffer_.get(),
+ bind_generates_resources,
+ lose_context_when_out_of_memory,
+ gpu_control_.get()));
if (!context_->Initialize(
kTransferBufferSize,
diff --git a/gpu/gles2_implementation.target.darwin-arm.mk b/gpu/gles2_implementation.target.darwin-arm.mk
index 6fe008bfa1..0dc2ac3f64 100644
--- a/gpu/gles2_implementation.target.darwin-arm.mk
+++ b/gpu/gles2_implementation.target.darwin-arm.mk
@@ -82,6 +82,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -206,6 +207,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/gles2_implementation.target.darwin-mips.mk b/gpu/gles2_implementation.target.darwin-mips.mk
index 0683de05c3..ab04572e33 100644
--- a/gpu/gles2_implementation.target.darwin-mips.mk
+++ b/gpu/gles2_implementation.target.darwin-mips.mk
@@ -81,6 +81,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -204,6 +205,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/gles2_implementation.target.darwin-x86.mk b/gpu/gles2_implementation.target.darwin-x86.mk
index 88e248f016..00ff64091a 100644
--- a/gpu/gles2_implementation.target.darwin-x86.mk
+++ b/gpu/gles2_implementation.target.darwin-x86.mk
@@ -83,6 +83,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -207,6 +208,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/gles2_implementation.target.darwin-x86_64.mk b/gpu/gles2_implementation.target.darwin-x86_64.mk
index fcd489914c..63df669654 100644
--- a/gpu/gles2_implementation.target.darwin-x86_64.mk
+++ b/gpu/gles2_implementation.target.darwin-x86_64.mk
@@ -83,6 +83,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -207,6 +208,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/gles2_implementation.target.linux-arm.mk b/gpu/gles2_implementation.target.linux-arm.mk
index 6fe008bfa1..0dc2ac3f64 100644
--- a/gpu/gles2_implementation.target.linux-arm.mk
+++ b/gpu/gles2_implementation.target.linux-arm.mk
@@ -82,6 +82,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -206,6 +207,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/gles2_implementation.target.linux-mips.mk b/gpu/gles2_implementation.target.linux-mips.mk
index 0683de05c3..ab04572e33 100644
--- a/gpu/gles2_implementation.target.linux-mips.mk
+++ b/gpu/gles2_implementation.target.linux-mips.mk
@@ -81,6 +81,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -204,6 +205,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/gles2_implementation.target.linux-x86.mk b/gpu/gles2_implementation.target.linux-x86.mk
index 88e248f016..00ff64091a 100644
--- a/gpu/gles2_implementation.target.linux-x86.mk
+++ b/gpu/gles2_implementation.target.linux-x86.mk
@@ -83,6 +83,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -207,6 +208,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/gles2_implementation.target.linux-x86_64.mk b/gpu/gles2_implementation.target.linux-x86_64.mk
index fcd489914c..63df669654 100644
--- a/gpu/gles2_implementation.target.linux-x86_64.mk
+++ b/gpu/gles2_implementation.target.linux-x86_64.mk
@@ -83,6 +83,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -207,6 +208,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/gpu.target.darwin-arm.mk b/gpu/gpu.target.darwin-arm.mk
index eb9f615f02..7c0692724f 100644
--- a/gpu/gpu.target.darwin-arm.mk
+++ b/gpu/gpu.target.darwin-arm.mk
@@ -74,6 +74,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -164,6 +165,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/gpu.target.darwin-mips.mk b/gpu/gpu.target.darwin-mips.mk
index 257efce787..1242c1eda8 100644
--- a/gpu/gpu.target.darwin-mips.mk
+++ b/gpu/gpu.target.darwin-mips.mk
@@ -73,6 +73,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -162,6 +163,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/gpu.target.darwin-x86.mk b/gpu/gpu.target.darwin-x86.mk
index 05991c602e..e9655d9138 100644
--- a/gpu/gpu.target.darwin-x86.mk
+++ b/gpu/gpu.target.darwin-x86.mk
@@ -75,6 +75,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -165,6 +166,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/gpu.target.darwin-x86_64.mk b/gpu/gpu.target.darwin-x86_64.mk
index 11db667c3f..3b2a54ab58 100644
--- a/gpu/gpu.target.darwin-x86_64.mk
+++ b/gpu/gpu.target.darwin-x86_64.mk
@@ -75,6 +75,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -165,6 +166,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/gpu.target.linux-arm.mk b/gpu/gpu.target.linux-arm.mk
index eb9f615f02..7c0692724f 100644
--- a/gpu/gpu.target.linux-arm.mk
+++ b/gpu/gpu.target.linux-arm.mk
@@ -74,6 +74,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -164,6 +165,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/gpu.target.linux-mips.mk b/gpu/gpu.target.linux-mips.mk
index 257efce787..1242c1eda8 100644
--- a/gpu/gpu.target.linux-mips.mk
+++ b/gpu/gpu.target.linux-mips.mk
@@ -73,6 +73,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -162,6 +163,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/gpu.target.linux-x86.mk b/gpu/gpu.target.linux-x86.mk
index 05991c602e..e9655d9138 100644
--- a/gpu/gpu.target.linux-x86.mk
+++ b/gpu/gpu.target.linux-x86.mk
@@ -75,6 +75,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -165,6 +166,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/gpu.target.linux-x86_64.mk b/gpu/gpu.target.linux-x86_64.mk
index 11db667c3f..3b2a54ab58 100644
--- a/gpu/gpu.target.linux-x86_64.mk
+++ b/gpu/gpu.target.linux-x86_64.mk
@@ -75,6 +75,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -165,6 +166,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/gpu_config.target.darwin-arm.mk b/gpu/gpu_config.target.darwin-arm.mk
index 6446b067f6..d886b06593 100644
--- a/gpu/gpu_config.target.darwin-arm.mk
+++ b/gpu/gpu_config.target.darwin-arm.mk
@@ -82,6 +82,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -177,6 +178,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/gpu_config.target.darwin-mips.mk b/gpu/gpu_config.target.darwin-mips.mk
index 41c6b9c06a..a76fd760f6 100644
--- a/gpu/gpu_config.target.darwin-mips.mk
+++ b/gpu/gpu_config.target.darwin-mips.mk
@@ -81,6 +81,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -175,6 +176,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/gpu_config.target.darwin-x86.mk b/gpu/gpu_config.target.darwin-x86.mk
index 6876bdbc25..9d0f74886a 100644
--- a/gpu/gpu_config.target.darwin-x86.mk
+++ b/gpu/gpu_config.target.darwin-x86.mk
@@ -83,6 +83,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -178,6 +179,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/gpu_config.target.darwin-x86_64.mk b/gpu/gpu_config.target.darwin-x86_64.mk
index 8ca1921418..2ef53fc155 100644
--- a/gpu/gpu_config.target.darwin-x86_64.mk
+++ b/gpu/gpu_config.target.darwin-x86_64.mk
@@ -83,6 +83,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -178,6 +179,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/gpu_config.target.linux-arm.mk b/gpu/gpu_config.target.linux-arm.mk
index 6446b067f6..d886b06593 100644
--- a/gpu/gpu_config.target.linux-arm.mk
+++ b/gpu/gpu_config.target.linux-arm.mk
@@ -82,6 +82,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -177,6 +178,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/gpu_config.target.linux-mips.mk b/gpu/gpu_config.target.linux-mips.mk
index 41c6b9c06a..a76fd760f6 100644
--- a/gpu/gpu_config.target.linux-mips.mk
+++ b/gpu/gpu_config.target.linux-mips.mk
@@ -81,6 +81,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -175,6 +176,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/gpu_config.target.linux-x86.mk b/gpu/gpu_config.target.linux-x86.mk
index 6876bdbc25..9d0f74886a 100644
--- a/gpu/gpu_config.target.linux-x86.mk
+++ b/gpu/gpu_config.target.linux-x86.mk
@@ -83,6 +83,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -178,6 +179,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/gpu_config.target.linux-x86_64.mk b/gpu/gpu_config.target.linux-x86_64.mk
index 8ca1921418..2ef53fc155 100644
--- a/gpu/gpu_config.target.linux-x86_64.mk
+++ b/gpu/gpu_config.target.linux-x86_64.mk
@@ -83,6 +83,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -178,6 +179,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/gpu_ipc.target.darwin-arm.mk b/gpu/gpu_ipc.target.darwin-arm.mk
index d1961196c3..5e7a05c5e3 100644
--- a/gpu/gpu_ipc.target.darwin-arm.mk
+++ b/gpu/gpu_ipc.target.darwin-arm.mk
@@ -70,6 +70,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -157,6 +158,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/gpu_ipc.target.darwin-mips.mk b/gpu/gpu_ipc.target.darwin-mips.mk
index 8d1c9b5a80..92036adecf 100644
--- a/gpu/gpu_ipc.target.darwin-mips.mk
+++ b/gpu/gpu_ipc.target.darwin-mips.mk
@@ -69,6 +69,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -155,6 +156,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/gpu_ipc.target.darwin-x86.mk b/gpu/gpu_ipc.target.darwin-x86.mk
index 1fdbe8010b..f331db2f1a 100644
--- a/gpu/gpu_ipc.target.darwin-x86.mk
+++ b/gpu/gpu_ipc.target.darwin-x86.mk
@@ -71,6 +71,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -158,6 +159,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/gpu_ipc.target.darwin-x86_64.mk b/gpu/gpu_ipc.target.darwin-x86_64.mk
index 603b028d76..f3f2e4442e 100644
--- a/gpu/gpu_ipc.target.darwin-x86_64.mk
+++ b/gpu/gpu_ipc.target.darwin-x86_64.mk
@@ -71,6 +71,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -158,6 +159,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/gpu_ipc.target.linux-arm.mk b/gpu/gpu_ipc.target.linux-arm.mk
index d1961196c3..5e7a05c5e3 100644
--- a/gpu/gpu_ipc.target.linux-arm.mk
+++ b/gpu/gpu_ipc.target.linux-arm.mk
@@ -70,6 +70,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -157,6 +158,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/gpu_ipc.target.linux-mips.mk b/gpu/gpu_ipc.target.linux-mips.mk
index 8d1c9b5a80..92036adecf 100644
--- a/gpu/gpu_ipc.target.linux-mips.mk
+++ b/gpu/gpu_ipc.target.linux-mips.mk
@@ -69,6 +69,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -155,6 +156,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/gpu_ipc.target.linux-x86.mk b/gpu/gpu_ipc.target.linux-x86.mk
index 1fdbe8010b..f331db2f1a 100644
--- a/gpu/gpu_ipc.target.linux-x86.mk
+++ b/gpu/gpu_ipc.target.linux-x86.mk
@@ -71,6 +71,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -158,6 +159,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/gpu_ipc.target.linux-x86_64.mk b/gpu/gpu_ipc.target.linux-x86_64.mk
index 603b028d76..f3f2e4442e 100644
--- a/gpu/gpu_ipc.target.linux-x86_64.mk
+++ b/gpu/gpu_ipc.target.linux-x86_64.mk
@@ -71,6 +71,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -158,6 +159,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/skia_bindings/gl_bindings_skia_cmd_buffer.cc b/gpu/skia_bindings/gl_bindings_skia_cmd_buffer.cc
index 9803816a13..b8079d12ca 100644
--- a/gpu/skia_bindings/gl_bindings_skia_cmd_buffer.cc
+++ b/gpu/skia_bindings/gl_bindings_skia_cmd_buffer.cc
@@ -51,6 +51,7 @@ GrGLInterface* CreateCommandBufferSkiaGLBinding() {
functions->fDepthMask = glDepthMask;
functions->fDisable = glDisable;
functions->fDisableVertexAttribArray = glDisableVertexAttribArray;
+ functions->fDiscardFramebuffer = glDiscardFramebufferEXT;
functions->fDrawArrays = glDrawArrays;
functions->fDrawElements = glDrawElements;
functions->fEnable = glEnable;
diff --git a/gpu/skia_bindings/gpu_skia_bindings.target.darwin-arm.mk b/gpu/skia_bindings/gpu_skia_bindings.target.darwin-arm.mk
index 85d7973903..9e481d63d5 100644
--- a/gpu/skia_bindings/gpu_skia_bindings.target.darwin-arm.mk
+++ b/gpu/skia_bindings/gpu_skia_bindings.target.darwin-arm.mk
@@ -71,6 +71,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -187,6 +188,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/skia_bindings/gpu_skia_bindings.target.darwin-mips.mk b/gpu/skia_bindings/gpu_skia_bindings.target.darwin-mips.mk
index c9c1a4d950..efdf604710 100644
--- a/gpu/skia_bindings/gpu_skia_bindings.target.darwin-mips.mk
+++ b/gpu/skia_bindings/gpu_skia_bindings.target.darwin-mips.mk
@@ -70,6 +70,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -185,6 +186,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/skia_bindings/gpu_skia_bindings.target.darwin-x86.mk b/gpu/skia_bindings/gpu_skia_bindings.target.darwin-x86.mk
index 701a5fde5f..b43209c9c1 100644
--- a/gpu/skia_bindings/gpu_skia_bindings.target.darwin-x86.mk
+++ b/gpu/skia_bindings/gpu_skia_bindings.target.darwin-x86.mk
@@ -72,6 +72,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -188,6 +189,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/skia_bindings/gpu_skia_bindings.target.darwin-x86_64.mk b/gpu/skia_bindings/gpu_skia_bindings.target.darwin-x86_64.mk
index 43582f4a12..ada94b7523 100644
--- a/gpu/skia_bindings/gpu_skia_bindings.target.darwin-x86_64.mk
+++ b/gpu/skia_bindings/gpu_skia_bindings.target.darwin-x86_64.mk
@@ -72,6 +72,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -188,6 +189,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/skia_bindings/gpu_skia_bindings.target.linux-arm.mk b/gpu/skia_bindings/gpu_skia_bindings.target.linux-arm.mk
index 85d7973903..9e481d63d5 100644
--- a/gpu/skia_bindings/gpu_skia_bindings.target.linux-arm.mk
+++ b/gpu/skia_bindings/gpu_skia_bindings.target.linux-arm.mk
@@ -71,6 +71,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -187,6 +188,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/skia_bindings/gpu_skia_bindings.target.linux-mips.mk b/gpu/skia_bindings/gpu_skia_bindings.target.linux-mips.mk
index c9c1a4d950..efdf604710 100644
--- a/gpu/skia_bindings/gpu_skia_bindings.target.linux-mips.mk
+++ b/gpu/skia_bindings/gpu_skia_bindings.target.linux-mips.mk
@@ -70,6 +70,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -185,6 +186,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/skia_bindings/gpu_skia_bindings.target.linux-x86.mk b/gpu/skia_bindings/gpu_skia_bindings.target.linux-x86.mk
index 701a5fde5f..b43209c9c1 100644
--- a/gpu/skia_bindings/gpu_skia_bindings.target.linux-x86.mk
+++ b/gpu/skia_bindings/gpu_skia_bindings.target.linux-x86.mk
@@ -72,6 +72,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -188,6 +189,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/gpu/skia_bindings/gpu_skia_bindings.target.linux-x86_64.mk b/gpu/skia_bindings/gpu_skia_bindings.target.linux-x86_64.mk
index 43582f4a12..ada94b7523 100644
--- a/gpu/skia_bindings/gpu_skia_bindings.target.linux-x86_64.mk
+++ b/gpu/skia_bindings/gpu_skia_bindings.target.linux-x86_64.mk
@@ -72,6 +72,7 @@ MY_DEFS_Debug := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -188,6 +189,7 @@ MY_DEFS_Release := \
'-DDISABLE_NACL' \
'-DCHROMIUM_BUILD' \
'-DUSE_LIBJPEG_TURBO=1' \
+ '-DENABLE_WEBRTC=1' \
'-DUSE_PROPRIETARY_CODECS' \
'-DENABLE_CONFIGURATION_POLICY' \
'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \