Add TransferCache methods to RasterDecoder
This CL does several things:
- Adds TransferCache methods to RasterDecoderImpl. This is
copy-and-paste from GLES2DecoderImpl (including OOP-R setup).
- Switches InProcCommandBuffer to use either RasterDecoder or
GLES2Decoder based on ContextCreationAttribs. Logic for decision
copied from GpuChannel.
- Adds RasterInProcessContext for use by tests (copy-and-paste from
GLInProcessContext but simpler).
- Parameterizes TransferCacheTest to test both RasterDecoder and
GLES2Decoder
Bug: 789238
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I2629f0a9469abfaaf10b10ae28076d3e0881eb66
Reviewed-on: https://chromium-review.googlesource.com/1011104
Reviewed-by: kylechar <[email protected]>
Commit-Queue: Jonathan Backer <[email protected]>
Cr-Commit-Position: refs/heads/master@{#551368}
diff --git a/gpu/ipc/in_process_command_buffer.cc b/gpu/ipc/in_process_command_buffer.cc
index cc1a53f..ef7d908 100644
--- a/gpu/ipc/in_process_command_buffer.cc
+++ b/gpu/ipc/in_process_command_buffer.cc
@@ -34,6 +34,7 @@
#include "gpu/command_buffer/service/context_group.h"
#include "gpu/command_buffer/service/gl_context_virtual.h"
#include "gpu/command_buffer/service/gl_state_restorer_impl.h"
+#include "gpu/command_buffer/service/gles2_cmd_decoder.h"
#include "gpu/command_buffer/service/gpu_fence_manager.h"
#include "gpu/command_buffer/service/gpu_preferences.h"
#include "gpu/command_buffer/service/gpu_tracer.h"
@@ -42,6 +43,7 @@
#include "gpu/command_buffer/service/memory_program_cache.h"
#include "gpu/command_buffer/service/memory_tracking.h"
#include "gpu/command_buffer/service/query_manager.h"
+#include "gpu/command_buffer/service/raster_decoder.h"
#include "gpu/command_buffer/service/service_utils.h"
#include "gpu/command_buffer/service/sync_point_manager.h"
#include "gpu/command_buffer/service/transfer_buffer_manager.h"
@@ -341,9 +343,18 @@
command_buffer_ = std::make_unique<CommandBufferService>(
this, transfer_buffer_manager_.get());
- decoder_.reset(gles2::GLES2Decoder::Create(this, command_buffer_.get(),
- service_->outputter(),
- context_group_.get()));
+
+ if (params.attribs.enable_raster_decoder &&
+ params.attribs.enable_raster_interface &&
+ !params.attribs.enable_gles2_interface) {
+ decoder_.reset(raster::RasterDecoder::Create(this, command_buffer_.get(),
+ service_->outputter(),
+ context_group_.get()));
+ } else {
+ decoder_.reset(gles2::GLES2Decoder::Create(this, command_buffer_.get(),
+ service_->outputter(),
+ context_group_.get()));
+ }
if (!surface_) {
if (params.is_offscreen) {
@@ -490,7 +501,7 @@
}
if (service_->gpu_preferences().enable_gpu_service_logging)
- decoder_->set_log_commands(true);
+ decoder_->SetLogCommands(true);
if (use_virtualized_gl_context_) {
// If virtualized GL contexts are in use, then real GL context state