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

Unified Diff: ui/gl/gl_image_dxgi.cc

Issue 2742593002: Add GLImageDXGI (Closed)
Patch Set: centralize cast Created 3 years, 9 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 | « ui/gl/gl_image_dxgi.h ('k') | 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
new file mode 100644
index 0000000000000000000000000000000000000000..2960a6ba10b47463754d811a7935f0e0c7fef599
--- /dev/null
+++ b/ui/gl/gl_image_dxgi.cc
@@ -0,0 +1,79 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/gl/gl_image_dxgi.h"
+
+#include "third_party/khronos/EGL/egl.h"
+#include "third_party/khronos/EGL/eglext.h"
+#include "ui/gl/gl_bindings.h"
+#include "ui/gl/gl_image.h"
+#include "ui/gl/gl_surface_egl.h"
+
+namespace gl {
+
+GLImageDXGI::GLImageDXGI(const gfx::Size& size, EGLStreamKHR stream)
+ : size_(size), stream_(stream) {}
+
+// static
+GLImageDXGI* GLImageDXGI::FromGLImage(GLImage* image) {
+ if (!image || image->GetType() != Type::DXGI_IMAGE)
+ return nullptr;
+ return static_cast<GLImageDXGI*>(image);
+}
+
+gfx::Size GLImageDXGI::GetSize() {
+ return size_;
+}
+
+unsigned GLImageDXGI::GetInternalFormat() {
+ return GL_BGRA_EXT;
+}
+
+bool GLImageDXGI::BindTexImage(unsigned target) {
+ return false;
+}
+
+void GLImageDXGI::ReleaseTexImage(unsigned target) {}
+
+bool GLImageDXGI::CopyTexImage(unsigned target) {
+ return false;
+}
+
+bool GLImageDXGI::CopyTexSubImage(unsigned target,
+ const gfx::Point& offset,
+ const gfx::Rect& rect) {
+ return false;
+}
+
+bool GLImageDXGI::ScheduleOverlayPlane(gfx::AcceleratedWidget widget,
+ int z_order,
+ gfx::OverlayTransform transform,
+ const gfx::Rect& bounds_rect,
+ const gfx::RectF& crop_rect) {
+ return false;
+}
+
+void GLImageDXGI::Flush() {}
+
+void GLImageDXGI::OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd,
+ uint64_t process_tracing_id,
+ const std::string& dump_name) {}
+
+GLImage::Type GLImageDXGI::GetType() const {
+ return Type::DXGI_IMAGE;
+}
+
+void GLImageDXGI::SetTexture(
+ const base::win::ScopedComPtr<ID3D11Texture2D>& texture,
+ size_t level) {
+ texture_ = texture;
+ level_ = level;
+}
+
+GLImageDXGI::~GLImageDXGI() {
+ EGLDisplay egl_display = gl::GLSurfaceEGL::GetHardwareDisplay();
+ eglDestroyStreamKHR(egl_display, stream_);
+}
+
+} // namespace gl
« no previous file with comments | « ui/gl/gl_image_dxgi.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698