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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include <d3d11.h>
6
7 #include "base/win/scoped_comptr.h"
8 #include "third_party/khronos/EGL/egl.h"
9 #include "third_party/khronos/EGL/eglext.h"
10 #include "ui/gl/gl_export.h"
11 #include "ui/gl/gl_image.h"
12
13 namespace gl {
14
15 class GL_EXPORT GLImageDXGI : public GLImage {
16 public:
17 GLImageDXGI(const gfx::Size& size, EGLStreamKHR stream);
18
19 // Safe downcast. Returns nullptr on failure.
20 static GLImageDXGI* FromGLImage(GLImage* image);
21
22 // GLImage implementation.
23 gfx::Size GetSize() override;
24 unsigned GetInternalFormat() override;
25 bool BindTexImage(unsigned target) override;
26 void ReleaseTexImage(unsigned target) override;
27 bool CopyTexImage(unsigned target) override;
28 bool CopyTexSubImage(unsigned target,
29 const gfx::Point& offset,
30 const gfx::Rect& rect) override;
31 bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget,
32 int z_order,
33 gfx::OverlayTransform transform,
34 const gfx::Rect& bounds_rect,
35 const gfx::RectF& crop_rect) override;
36 void Flush() override;
37 void OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd,
38 uint64_t process_tracing_id,
39 const std::string& dump_name) override;
40 Type GetType() const override;
41
42 void SetTexture(const base::win::ScopedComPtr<ID3D11Texture2D>& texture,
43 size_t level);
44
45 base::win::ScopedComPtr<ID3D11Texture2D> texture() { return texture_; }
46 size_t level() const { return level_; }
47
48 protected:
49 ~GLImageDXGI() override;
50
51 private:
52 gfx::Size size_;
53
54 EGLStreamKHR stream_;
55
56 base::win::ScopedComPtr<ID3D11Texture2D> texture_;
57 size_t level_ = 0;
58 };
59 }
OLDNEW
« 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