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

Side by Side Diff: content/common/gpu/media/vt_video_decode_accelerator.cc

Issue 1354483004: Re-land: ui: Add GLImage unit test framework. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: deps fix Created 5 years, 2 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
OLDNEW
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 1023 matching lines...) Expand 10 before | Expand all | Expand 10 after
1034 GL_UNSIGNED_SHORT_8_8_APPLE, // type 1034 GL_UNSIGNED_SHORT_8_8_APPLE, // type
1035 surface, // io_surface 1035 surface, // io_surface
1036 0); // plane 1036 0); // plane
1037 glDisable(GL_TEXTURE_RECTANGLE_ARB); 1037 glDisable(GL_TEXTURE_RECTANGLE_ARB);
1038 if (status != kCGLNoError) { 1038 if (status != kCGLNoError) {
1039 NOTIFY_STATUS("CGLTexImageIOSurface2D()", status, SFT_PLATFORM_ERROR); 1039 NOTIFY_STATUS("CGLTexImageIOSurface2D()", status, SFT_PLATFORM_ERROR);
1040 return false; 1040 return false;
1041 } 1041 }
1042 1042
1043 bool allow_overlay = false; 1043 bool allow_overlay = false;
1044 scoped_refptr<gfx::GLImageIOSurface> gl_image(new gfx::GLImageIOSurface( 1044 scoped_refptr<gfx::GLImageIOSurface> gl_image(
1045 gfx::GenericSharedMemoryId(), frame.coded_size, GL_BGRA_EXT)); 1045 new gfx::GLImageIOSurface(frame.coded_size, GL_BGRA_EXT));
1046 if (gl_image->Initialize(surface, gfx::BufferFormat::BGRA_8888)) { 1046 if (gl_image->Initialize(surface, gfx::GenericSharedMemoryId(),
1047 gfx::BufferFormat::BGRA_8888)) {
1047 allow_overlay = true; 1048 allow_overlay = true;
1048 } else { 1049 } else {
1049 gl_image = nullptr; 1050 gl_image = nullptr;
1050 } 1051 }
1051 bind_image_.Run(picture_info->client_texture_id, GL_TEXTURE_RECTANGLE_ARB, 1052 bind_image_.Run(picture_info->client_texture_id, GL_TEXTURE_RECTANGLE_ARB,
1052 gl_image); 1053 gl_image);
1053 1054
1054 // Assign the new image(s) to the the picture info. 1055 // Assign the new image(s) to the the picture info.
1055 picture_info->gl_image = gl_image; 1056 picture_info->gl_image = gl_image;
1056 picture_info->cv_image = frame.image; 1057 picture_info->cv_image = frame.image;
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
1138 SupportedProfile profile; 1139 SupportedProfile profile;
1139 profile.profile = supported_profile; 1140 profile.profile = supported_profile;
1140 profile.min_resolution.SetSize(16, 16); 1141 profile.min_resolution.SetSize(16, 16);
1141 profile.max_resolution.SetSize(4096, 2160); 1142 profile.max_resolution.SetSize(4096, 2160);
1142 profiles.push_back(profile); 1143 profiles.push_back(profile);
1143 } 1144 }
1144 return profiles; 1145 return profiles;
1145 } 1146 }
1146 1147
1147 } // namespace content 1148 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698