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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « ui/gl/gl_image_dxgi.h ('k') | no next file » | 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 "ui/gl/gl_image_dxgi.h"
6
7 #include "third_party/khronos/EGL/egl.h"
8 #include "third_party/khronos/EGL/eglext.h"
9 #include "ui/gl/gl_bindings.h"
10 #include "ui/gl/gl_image.h"
11 #include "ui/gl/gl_surface_egl.h"
12
13 namespace gl {
14
15 GLImageDXGI::GLImageDXGI(const gfx::Size& size, EGLStreamKHR stream)
16 : size_(size), stream_(stream) {}
17
18 // static
19 GLImageDXGI* GLImageDXGI::FromGLImage(GLImage* image) {
20 if (!image || image->GetType() != Type::DXGI_IMAGE)
21 return nullptr;
22 return static_cast<GLImageDXGI*>(image);
23 }
24
25 gfx::Size GLImageDXGI::GetSize() {
26 return size_;
27 }
28
29 unsigned GLImageDXGI::GetInternalFormat() {
30 return GL_BGRA_EXT;
31 }
32
33 bool GLImageDXGI::BindTexImage(unsigned target) {
34 return false;
35 }
36
37 void GLImageDXGI::ReleaseTexImage(unsigned target) {}
38
39 bool GLImageDXGI::CopyTexImage(unsigned target) {
40 return false;
41 }
42
43 bool GLImageDXGI::CopyTexSubImage(unsigned target,
44 const gfx::Point& offset,
45 const gfx::Rect& rect) {
46 return false;
47 }
48
49 bool GLImageDXGI::ScheduleOverlayPlane(gfx::AcceleratedWidget widget,
50 int z_order,
51 gfx::OverlayTransform transform,
52 const gfx::Rect& bounds_rect,
53 const gfx::RectF& crop_rect) {
54 return false;
55 }
56
57 void GLImageDXGI::Flush() {}
58
59 void GLImageDXGI::OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd,
60 uint64_t process_tracing_id,
61 const std::string& dump_name) {}
62
63 GLImage::Type GLImageDXGI::GetType() const {
64 return Type::DXGI_IMAGE;
65 }
66
67 void GLImageDXGI::SetTexture(
68 const base::win::ScopedComPtr<ID3D11Texture2D>& texture,
69 size_t level) {
70 texture_ = texture;
71 level_ = level;
72 }
73
74 GLImageDXGI::~GLImageDXGI() {
75 EGLDisplay egl_display = gl::GLSurfaceEGL::GetHardwareDisplay();
76 eglDestroyStreamKHR(egl_display, stream_);
77 }
78
79 } // namespace gl
OLDNEW
« 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