Index: gpu/ipc/service/direct_composition_surface_win_unittest.cc |
diff --git a/gpu/ipc/service/direct_composition_surface_win_unittest.cc b/gpu/ipc/service/direct_composition_surface_win_unittest.cc |
index 264c44bf65e0f716c9766c6059b8ad76cffc6c09..62d9cb52bc3d98891e5901e61fdb65f775c3a99f 100644 |
--- a/gpu/ipc/service/direct_composition_surface_win_unittest.cc |
+++ b/gpu/ipc/service/direct_composition_surface_win_unittest.cc |
@@ -111,8 +111,7 @@ |
base::win::ScopedComPtr<ID3D11Texture2D> CreateNV12Texture( |
const base::win::ScopedComPtr<ID3D11Device>& d3d11_device, |
- const gfx::Size& size, |
- bool shared) { |
+ const gfx::Size& size) { |
D3D11_TEXTURE2D_DESC desc = {}; |
desc.Width = size.width(); |
desc.Height = size.height(); |
@@ -122,10 +121,6 @@ |
desc.Usage = D3D11_USAGE_DEFAULT; |
desc.SampleDesc.Count = 1; |
desc.BindFlags = 0; |
- if (shared) { |
- desc.MiscFlags = D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX | |
- D3D11_RESOURCE_MISC_SHARED_NTHANDLE; |
- } |
std::vector<char> image_data(size.width() * size.height() * 3 / 2); |
// Y, U, and V should all be Oxff. Output color should be pink. |
@@ -322,7 +317,7 @@ |
gfx::Size texture_size(50, 50); |
base::win::ScopedComPtr<ID3D11Texture2D> texture = |
- CreateNV12Texture(d3d11_device, texture_size, false); |
+ CreateNV12Texture(d3d11_device, texture_size); |
scoped_refptr<gl::GLImageDXGI> image_dxgi( |
new gl::GLImageDXGI(texture_size, nullptr)); |
@@ -498,7 +493,7 @@ |
gfx::Size texture_size(50, 50); |
base::win::ScopedComPtr<ID3D11Texture2D> texture = |
- CreateNV12Texture(d3d11_device, texture_size, false); |
+ CreateNV12Texture(d3d11_device, texture_size); |
scoped_refptr<gl::GLImageDXGI> image_dxgi( |
new gl::GLImageDXGI(texture_size, nullptr)); |
@@ -587,55 +582,5 @@ |
context = nullptr; |
DestroySurface(std::move(surface_)); |
} |
- |
-TEST_F(DirectCompositionPixelTest, VideoHandleSwapchain) { |
- if (!CheckIfDCSupported()) |
- return; |
- InitializeSurface(); |
- surface_->SetEnableDCLayers(true); |
- 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, true)); |
- |
- base::win::ScopedComPtr<ID3D11Device> d3d11_device = |
- gl::QueryD3D11DeviceObjectFromANGLE(); |
- |
- gfx::Size texture_size(50, 50); |
- base::win::ScopedComPtr<ID3D11Texture2D> texture = |
- CreateNV12Texture(d3d11_device, texture_size, true); |
- base::win::ScopedComPtr<IDXGIResource1> resource; |
- texture.CopyTo(resource.GetAddressOf()); |
- HANDLE handle; |
- resource->CreateSharedHandle(nullptr, DXGI_SHARED_RESOURCE_READ, nullptr, |
- &handle); |
- |
- scoped_refptr<gl::GLImageDXGIHandle> image_dxgi(new gl::GLImageDXGIHandle( |
- texture_size, base::win::ScopedHandle(handle), 0)); |
- ASSERT_TRUE(image_dxgi->Initialize()); |
- |
- ui::DCRendererLayerParams params( |
- false, gfx::Rect(), 1, gfx::Transform(), |
- std::vector<scoped_refptr<gl::GLImage>>{image_dxgi}, |
- gfx::RectF(gfx::Rect(texture_size)), gfx::Rect(window_size), 0, 0, 1.0, |
- 0); |
- surface_->ScheduleDCLayer(params); |
- |
- EXPECT_EQ(gfx::SwapResult::SWAP_ACK, surface_->SwapBuffers()); |
- |
- Sleep(1000); |
- |
- SkColor expected_color = SkColorSetRGB(0xff, 0xb7, 0xff); |
- SkColor actual_color = |
- ReadBackWindowPixel(window_.hwnd(), gfx::Point(75, 75)); |
- EXPECT_TRUE(AreColorsSimilar(expected_color, actual_color)) |
- << std::hex << "Expected " << expected_color << " Actual " |
- << actual_color; |
- |
- context = nullptr; |
- DestroySurface(std::move(surface_)); |
-} |
- |
} // namespace |
} // namespace gpu |