Commit e1aab717 authored by Eric Karl's avatar Eric Karl Committed by Commit Bot

Clean up redundant logic in TestInProcessContextProvider

We used to fake out the Gpu::Capabilities in TestInProcessContextProvider with some custom logic.
This logic appears to be redundant with the actual capabilities we can get from the real context.
Additionally, as this code is used in pixel tests, having fake capabilities that mismatch with the
real capabilities seems risky, so if the real caps are working it feels like we should use them.

Also cleans up some other unused code.

R=enne

Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.android:android_optional_gpu_tests_rel
Change-Id: I1bf82739387a358e95372efb1dac571d7ed15cbe
Reviewed-on: https://chromium-review.googlesource.com/957315Reviewed-by: default avatarenne <enne@chromium.org>
Commit-Queue: Eric Karl <ericrk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#542257}
parent d29a8b4b
...@@ -72,18 +72,6 @@ TestInProcessContextProvider::TestInProcessContextProvider( ...@@ -72,18 +72,6 @@ TestInProcessContextProvider::TestInProcessContextProvider(
cache_controller_.reset(new viz::ContextCacheController( cache_controller_.reset(new viz::ContextCacheController(
context_->GetImplementation(), base::ThreadTaskRunnerHandle::Get())); context_->GetImplementation(), base::ThreadTaskRunnerHandle::Get()));
capabilities_.texture_rectangle = true;
capabilities_.sync_query = true;
capabilities_.texture_norm16 = true;
switch (viz::PlatformColor::Format()) {
case viz::PlatformColor::SOURCE_FORMAT_RGBA8:
capabilities_.texture_format_bgra8888 = false;
break;
case viz::PlatformColor::SOURCE_FORMAT_BGRA8:
capabilities_.texture_format_bgra8888 = true;
break;
}
raster_implementation_ = raster_implementation_ =
std::make_unique<gpu::raster::RasterImplementationGLES>( std::make_unique<gpu::raster::RasterImplementationGLES>(
context_->GetImplementation(), context_->GetImplementation(), context_->GetImplementation(), context_->GetImplementation(),
...@@ -146,7 +134,7 @@ base::Lock* TestInProcessContextProvider::GetLock() { ...@@ -146,7 +134,7 @@ base::Lock* TestInProcessContextProvider::GetLock() {
const gpu::Capabilities& TestInProcessContextProvider::ContextCapabilities() const gpu::Capabilities& TestInProcessContextProvider::ContextCapabilities()
const { const {
return capabilities_; return context_->GetCapabilities();
} }
const gpu::GpuFeatureInfo& TestInProcessContextProvider::GetGpuFeatureInfo() const gpu::GpuFeatureInfo& TestInProcessContextProvider::GetGpuFeatureInfo()
......
...@@ -60,9 +60,6 @@ class TestInProcessContextProvider ...@@ -60,9 +60,6 @@ class TestInProcessContextProvider
const gpu::GpuFeatureInfo& GetGpuFeatureInfo() const override; const gpu::GpuFeatureInfo& GetGpuFeatureInfo() const override;
void AddObserver(viz::ContextLostObserver* obs) override {} void AddObserver(viz::ContextLostObserver* obs) override {}
void RemoveObserver(viz::ContextLostObserver* obs) override {} void RemoveObserver(viz::ContextLostObserver* obs) override {}
void SetSupportTextureNorm16(bool support) {
capabilities_texture_norm16_ = support;
}
protected: protected:
friend class base::RefCountedThreadSafe<TestInProcessContextProvider>; friend class base::RefCountedThreadSafe<TestInProcessContextProvider>;
...@@ -76,8 +73,6 @@ class TestInProcessContextProvider ...@@ -76,8 +73,6 @@ class TestInProcessContextProvider
std::unique_ptr<skia_bindings::GrContextForGLES2Interface> gr_context_; std::unique_ptr<skia_bindings::GrContextForGLES2Interface> gr_context_;
std::unique_ptr<viz::ContextCacheController> cache_controller_; std::unique_ptr<viz::ContextCacheController> cache_controller_;
base::Lock context_lock_; base::Lock context_lock_;
bool capabilities_texture_norm16_ = false;
gpu::Capabilities capabilities_;
gpu::GpuFeatureInfo gpu_feature_info_; gpu::GpuFeatureInfo gpu_feature_info_;
}; };
......
...@@ -1449,13 +1449,10 @@ class VideoGLRendererPixelHiLoTest ...@@ -1449,13 +1449,10 @@ class VideoGLRendererPixelHiLoTest
::testing::tuple<bool, HighbitTexture>> { ::testing::tuple<bool, HighbitTexture>> {
public: public:
void SetSupportHighbitTexture(HighbitTexture texture) { void SetSupportHighbitTexture(HighbitTexture texture) {
cc::TestInProcessContextProvider* context_provider =
GetTestInProcessContextProvider();
switch (texture) { switch (texture) {
case HighbitTexture::Y8: case HighbitTexture::Y8:
break; break;
case HighbitTexture::R16_EXT: case HighbitTexture::R16_EXT:
context_provider->SetSupportTextureNorm16(true);
video_resource_updater_->SetUseR16ForTesting(true); video_resource_updater_->SetUseR16ForTesting(true);
break; break;
} }
......
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