OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <algorithm> | 5 #include <algorithm> |
6 | 6 |
7 #include <CoreVideo/CoreVideo.h> | 7 #include <CoreVideo/CoreVideo.h> |
8 #include <OpenGL/CGLIOSurface.h> | 8 #include <OpenGL/CGLIOSurface.h> |
9 #include <OpenGL/gl.h> | 9 #include <OpenGL/gl.h> |
10 | 10 |
(...skipping 1026 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1037 surface, // io_surface | 1037 surface, // io_surface |
1038 0); // plane | 1038 0); // plane |
1039 if (gfx::GetGLImplementation() != gfx::kGLImplementationDesktopGLCoreProfile) | 1039 if (gfx::GetGLImplementation() != gfx::kGLImplementationDesktopGLCoreProfile) |
1040 glDisable(GL_TEXTURE_RECTANGLE_ARB); | 1040 glDisable(GL_TEXTURE_RECTANGLE_ARB); |
1041 if (status != kCGLNoError) { | 1041 if (status != kCGLNoError) { |
1042 NOTIFY_STATUS("CGLTexImageIOSurface2D()", status, SFT_PLATFORM_ERROR); | 1042 NOTIFY_STATUS("CGLTexImageIOSurface2D()", status, SFT_PLATFORM_ERROR); |
1043 return false; | 1043 return false; |
1044 } | 1044 } |
1045 | 1045 |
1046 bool allow_overlay = false; | 1046 bool allow_overlay = false; |
1047 scoped_refptr<gfx::GLImageIOSurface> gl_image(new gfx::GLImageIOSurface( | 1047 scoped_refptr<gfx::GLImageIOSurface> gl_image( |
1048 gfx::GenericSharedMemoryId(), frame.coded_size, GL_BGRA_EXT)); | 1048 new gfx::GLImageIOSurface(frame.coded_size, GL_BGRA_EXT)); |
1049 if (gl_image->Initialize(surface, gfx::BufferFormat::BGRA_8888)) { | 1049 if (gl_image->Initialize(surface, gfx::GenericSharedMemoryId(), |
| 1050 gfx::BufferFormat::BGRA_8888)) { |
1050 allow_overlay = true; | 1051 allow_overlay = true; |
1051 } else { | 1052 } else { |
1052 gl_image = nullptr; | 1053 gl_image = nullptr; |
1053 } | 1054 } |
1054 bind_image_.Run(picture_info->client_texture_id, GL_TEXTURE_RECTANGLE_ARB, | 1055 bind_image_.Run(picture_info->client_texture_id, GL_TEXTURE_RECTANGLE_ARB, |
1055 gl_image); | 1056 gl_image); |
1056 | 1057 |
1057 // Assign the new image(s) to the the picture info. | 1058 // Assign the new image(s) to the the picture info. |
1058 picture_info->gl_image = gl_image; | 1059 picture_info->gl_image = gl_image; |
1059 picture_info->cv_image = frame.image; | 1060 picture_info->cv_image = frame.image; |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1141 SupportedProfile profile; | 1142 SupportedProfile profile; |
1142 profile.profile = supported_profile; | 1143 profile.profile = supported_profile; |
1143 profile.min_resolution.SetSize(16, 16); | 1144 profile.min_resolution.SetSize(16, 16); |
1144 profile.max_resolution.SetSize(4096, 2160); | 1145 profile.max_resolution.SetSize(4096, 2160); |
1145 profiles.push_back(profile); | 1146 profiles.push_back(profile); |
1146 } | 1147 } |
1147 return profiles; | 1148 return profiles; |
1148 } | 1149 } |
1149 | 1150 |
1150 } // namespace content | 1151 } // namespace content |
OLD | NEW |