Commit 053aa6ca authored by Jonah Chin's avatar Jonah Chin Committed by Chromium LUCI CQ

Enable OOPR mode in PaintCanvasVideoRenderer tests

This CL parameterizes PaintCanvasVideoRendererWithGLTests to run tests
with and without OOP raster.

It also updates RasterInProcessContext to use the thread's task runner
instead of TestSimpleTaskRunner. This ensures that OOPR tests can still
use base::RunLoop::Run to trigger their posted callbacks.

Bug: 1115217
Change-Id: I663bf6c2cb9ce2d13222a2bb8bc7f6189a91e517
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2519172Reviewed-by: default avatarVasiliy Telezhnikov <vasilyt@chromium.org>
Reviewed-by: default avatarDale Curtis <dalecurtis@chromium.org>
Reviewed-by: default avatarJonathan Backer <backer@chromium.org>
Commit-Queue: Jonah Chin <jochin@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#846286}
parent 065a642d
......@@ -619,7 +619,7 @@ class RasterDecoderImpl final : public RasterDecoder,
GLenum subsampling,
const volatile GLbyte* mailboxes);
void DoLoseContextCHROMIUM(GLenum current, GLenum other) { NOTIMPLEMENTED(); }
void DoLoseContextCHROMIUM(GLenum current, GLenum other);
void DoBeginRasterCHROMIUM(GLuint sk_color,
GLuint msaa_sample_count,
GLboolean can_use_lcd_text,
......@@ -2876,6 +2876,10 @@ void RasterDecoderImpl::DoConvertYUVAMailboxesToRGBINTERNAL(
}
}
void RasterDecoderImpl::DoLoseContextCHROMIUM(GLenum current, GLenum other) {
MarkContextLost(gles2::GetContextLostReasonFromResetStatus(current));
}
namespace {
// Helper to read client data from transfer cache.
......
......@@ -107,6 +107,12 @@ GLuint GetGrGLBackendTextureFormat(const gles2::FeatureInfo* feature_info,
use_version_es2 = base::FeatureList::IsEnabled(features::kUseGles2ForOopR);
#endif
// Use R8 when using later GLs where LUMINANCE8 is deprecated
if (feature_info->gl_version_info().NeedsLuminanceAlphaEmulation() &&
internal_format == GL_LUMINANCE8) {
internal_format = GL_R8_EXT;
}
// We tell Skia to use es2 which does not have GL_R8_EXT
if (feature_info->gl_version_info().is_es3 && use_version_es2) {
if (internal_format == GL_R8_EXT)
......
......@@ -9,7 +9,8 @@
#include "base/bind.h"
#include "base/command_line.h"
#include "base/logging.h"
#include "base/test/test_simple_task_runner.h"
#include "base/run_loop.h"
#include "base/threading/thread_task_runner_handle.h"
#include "gpu/command_buffer/client/gles2_cmd_helper.h"
#include "gpu/command_buffer/client/raster_cmd_helper.h"
#include "gpu/command_buffer/client/raster_implementation.h"
......@@ -34,7 +35,7 @@ RasterInProcessContext::~RasterInProcessContext() {
// and service threads. Then execute any pending tasks.
if (raster_implementation_) {
raster_implementation_->Finish();
client_task_runner_->RunUntilIdle();
base::RunLoop().RunUntilIdle();
raster_implementation_.reset();
}
transfer_buffer_.reset();
......@@ -60,13 +61,12 @@ ContextResult RasterInProcessContext::Initialize(
return ContextResult::kFatalFailure;
}
client_task_runner_ = base::MakeRefCounted<base::TestSimpleTaskRunner>();
command_buffer_ =
std::make_unique<InProcessCommandBuffer>(task_executor, GURL());
auto result = command_buffer_->Initialize(
nullptr /* surface */, true /* is_offscreen */, kNullSurfaceHandle,
attribs, gpu_memory_buffer_manager, image_factory,
gpu_channel_manager_delegate, client_task_runner_,
gpu_channel_manager_delegate, base::ThreadTaskRunnerHandle::Get(),
nullptr /* task_sequence */,
nullptr /*display_compositor_memory_and_task_controller_on_gpu */,
gr_shader_cache, activity_flags);
......
......@@ -13,10 +13,6 @@
#include "gpu/ipc/command_buffer_task_executor.h"
#include "gpu/ipc/in_process_command_buffer.h"
namespace base {
class TestSimpleTaskRunner;
} // namespace base
namespace gpu {
class CommandBufferHelper;
class ContextSupport;
......@@ -76,7 +72,6 @@ class RasterInProcessContext {
std::unique_ptr<TransferBuffer> transfer_buffer_;
std::unique_ptr<raster::RasterImplementation> raster_implementation_;
std::unique_ptr<InProcessCommandBuffer> command_buffer_;
scoped_refptr<base::TestSimpleTaskRunner> client_task_runner_;
DISALLOW_COPY_AND_ASSIGN(RasterInProcessContext);
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment