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

Unified Diff: ui/gl/gl_image_dxgi.h

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.h ('k') | ui/gl/gl_image_dxgi.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_image_dxgi.h
diff --git a/ui/gl/gl_image_dxgi.h b/ui/gl/gl_image_dxgi.h
new file mode 100644
index 0000000000000000000000000000000000000000..10d5b2405ff2a4eadaa339543d75f1b18b58ac52
--- /dev/null
+++ b/ui/gl/gl_image_dxgi.h
@@ -0,0 +1,59 @@
+// 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 <d3d11.h>
+
+#include "base/win/scoped_comptr.h"
+#include "third_party/khronos/EGL/egl.h"
+#include "third_party/khronos/EGL/eglext.h"
+#include "ui/gl/gl_export.h"
+#include "ui/gl/gl_image.h"
+
+namespace gl {
+
+class GL_EXPORT GLImageDXGI : public GLImage {
+ public:
+ GLImageDXGI(const gfx::Size& size, EGLStreamKHR stream);
+
+ // Safe downcast. Returns nullptr on failure.
+ static GLImageDXGI* FromGLImage(GLImage* image);
+
+ // GLImage implementation.
+ gfx::Size GetSize() override;
+ unsigned GetInternalFormat() override;
+ bool BindTexImage(unsigned target) override;
+ void ReleaseTexImage(unsigned target) override;
+ bool CopyTexImage(unsigned target) override;
+ bool CopyTexSubImage(unsigned target,
+ const gfx::Point& offset,
+ const gfx::Rect& rect) override;
+ bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget,
+ int z_order,
+ gfx::OverlayTransform transform,
+ const gfx::Rect& bounds_rect,
+ const gfx::RectF& crop_rect) override;
+ void Flush() override;
+ void OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd,
+ uint64_t process_tracing_id,
+ const std::string& dump_name) override;
+ Type GetType() const override;
+
+ void SetTexture(const base::win::ScopedComPtr<ID3D11Texture2D>& texture,
+ size_t level);
+
+ base::win::ScopedComPtr<ID3D11Texture2D> texture() { return texture_; }
+ size_t level() const { return level_; }
+
+ protected:
+ ~GLImageDXGI() override;
+
+ private:
+ gfx::Size size_;
+
+ EGLStreamKHR stream_;
+
+ base::win::ScopedComPtr<ID3D11Texture2D> texture_;
+ size_t level_ = 0;
+};
+}
« no previous file with comments | « ui/gl/gl_image.h ('k') | ui/gl/gl_image_dxgi.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698