Skip to content

Commit

Permalink
Revert "DC: Use shader-readable texture when layers disabled."
Browse files Browse the repository at this point in the history
This reverts commit 7bf349f.

Reason for revert: Seems to have caused crashes on Canary.
BUG=761239

Original change's description:
> DC: Use shader-readable texture when layers disabled.
> 
> Also add a test to cover a bug where a non-shader-readable texture was
> sent to ANGLE. ANGLE has worked around this limitation in [1], but
> it's still helpful to create a compatible texture when possible.
> 
> [1]: https://chromium-review.googlesource.com/638551
> 
> BUG=752917
> 
> Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
> Change-Id: I771f32db459890bb2a0f08cd33ed8770ebf090ca
> Reviewed-on: https://chromium-review.googlesource.com/638911
> Reviewed-by: Antoine Labour <piman@chromium.org>
> Reviewed-by: John Bauman <jbauman@chromium.org>
> Commit-Queue: Jamie Madill <jmadill@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#498131}

TBR=jbauman@chromium.org,jmadill@chromium.org,piman@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 752917
Change-Id: I75b94d1971f213230ccaf540e2b17e684966faa5
Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Reviewed-on: https://chromium-review.googlesource.com/648026
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Cr-Commit-Position: refs/heads/master@{#499274}
  • Loading branch information
null77 authored and Commit Bot committed Sep 1, 2017
1 parent c794cf6 commit 25621bb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 36 deletions.
3 changes: 1 addition & 2 deletions gpu/ipc/service/direct_composition_child_surface_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ bool DirectCompositionChildSurfaceWin::InitializeSurface() {
desc.Stereo = FALSE;
desc.SampleDesc.Count = 1;
desc.BufferCount = 2;
desc.BufferUsage =
DXGI_USAGE_RENDER_TARGET_OUTPUT | DXGI_USAGE_SHADER_INPUT;
desc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
desc.Scaling = DXGI_SCALING_STRETCH;
desc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL;
desc.AlphaMode = alpha_mode;
Expand Down
34 changes: 0 additions & 34 deletions gpu/ipc/service/direct_composition_surface_win_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -472,32 +472,6 @@ class DirectCompositionPixelTest : public testing::Test {
DestroySurface(std::move(surface_));
}

void PixelTestCopyTexture(bool layers_enabled) {
if (!CheckIfDCSupported())
return;
InitializeSurface();
surface_->SetEnableDCLayers(layers_enabled);
gfx::Size window_size(100, 100);

scoped_refptr<gl::GLContext> context = gl::init::CreateGLContext(
nullptr, surface_.get(), gl::GLContextAttribs());
EXPECT_TRUE(surface_->Resize(window_size, 1.0,
gl::GLSurface::ColorSpace::UNSPECIFIED, true));

EXPECT_TRUE(surface_->SetDrawRectangle(gfx::Rect(0, 0, 100, 100)));
EXPECT_TRUE(context->MakeCurrent(surface_.get()));

Sleep(1000);

GLuint texture = 0;
glGenTextures(1, &texture);
glBindTexture(GL_TEXTURE_2D, texture);
glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 0, 0, 100, 100, 0);

context = nullptr;
DestroySurface(std::move(surface_));
}

TestPlatformDelegate platform_delegate_;
TestImageTransportSurfaceDelegate delegate_;
ui::WinWindow window_;
Expand All @@ -512,14 +486,6 @@ TEST_F(DirectCompositionPixelTest, DCLayersDisabled) {
PixelTestSwapChain(false);
}

TEST_F(DirectCompositionPixelTest, CopyTextureFromSurfaceWithLayersEnabled) {
PixelTestCopyTexture(true);
}

TEST_F(DirectCompositionPixelTest, CopyTextureFromSurfaceWithLayersDisabled) {
PixelTestCopyTexture(false);
}

bool AreColorsSimilar(int a, int b) {
// The precise colors may differ depending on the video processor, so allow
// a margin for error.
Expand Down

0 comments on commit 25621bb

Please sign in to comment.