Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(640)

Unified Diff: ui/gl/gl_image_dxgi.cc

Issue 2917493002: CHECK that video textures and processors are created on right context. (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_image_dxgi.cc
diff --git a/ui/gl/gl_image_dxgi.cc b/ui/gl/gl_image_dxgi.cc
index a470f3305b2b36b53be710cd92dd4e3e997921f6..a7ab19cf44df003c07a5ee0e6364fdfbbd05a200 100644
--- a/ui/gl/gl_image_dxgi.cc
+++ b/ui/gl/gl_image_dxgi.cc
@@ -118,6 +118,10 @@ bool CopyingGLImageDXGI::Initialize() {
base::win::ScopedComPtr<ID3D11DeviceContext> context;
d3d11_device_->GetImmediateContext(context.GetAddressOf());
context.CopyTo(video_context_.GetAddressOf());
+
+ base::win::ScopedComPtr<ID3D10Multithread> multithread;
+ d3d11_device_.CopyTo(multithread.GetAddressOf());
+ CHECK(multithread->GetMultithreadProtected());
return true;
}
@@ -126,6 +130,10 @@ bool CopyingGLImageDXGI::InitializeVideoProcessor(
const base::win::ScopedComPtr<ID3D11VideoProcessorEnumerator>& enumerator) {
output_view_.Reset();
+ base::win::ScopedComPtr<ID3D11Device> processor_device;
+ video_processor->GetDevice(processor_device.GetAddressOf());
+ CHECK_EQ(d3d11_device_.Get(), processor_device.Get());
+
d3d11_processor_ = video_processor;
enumerator_ = enumerator;
D3D11_VIDEO_PROCESSOR_OUTPUT_VIEW_DESC output_view_desc = {
@@ -150,6 +158,11 @@ bool CopyingGLImageDXGI::BindTexImage(unsigned target) {
if (copied_)
return true;
+ CHECK(video_device_);
+ base::win::ScopedComPtr<ID3D11Device> texture_device;
+ texture_->GetDevice(texture_device.GetAddressOf());
+ CHECK_EQ(d3d11_device_.Get(), texture_device.Get());
+
D3D11_VIDEO_PROCESSOR_INPUT_VIEW_DESC input_view_desc = {0};
input_view_desc.ViewDimension = D3D11_VPIV_DIMENSION_TEXTURE2D;
input_view_desc.Texture2D.ArraySlice = (UINT)level_;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698