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

Side by Side Diff: ui/ozone/platform/drm/gpu/gbm_surface.cc

Issue 2388653002: gpu: Add CHROMIUM_texture_from_image spec and fence support.
Patch Set: rebase Created 4 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
« ui/gl/gl_image.h ('K') | « ui/gl/test/gl_image_test_template.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
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "ui/ozone/platform/drm/gpu/gbm_surface.h" 5 #include "ui/ozone/platform/drm/gpu/gbm_surface.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "ui/gl/gl_surface_egl.h" 10 #include "ui/gl/gl_surface_egl.h"
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 scoped_refptr<GLImageOzoneNativePixmap> image = 132 scoped_refptr<GLImageOzoneNativePixmap> image =
133 new GLImageOzoneNativePixmap(GetSize(), GL_BGRA_EXT); 133 new GLImageOzoneNativePixmap(GetSize(), GL_BGRA_EXT);
134 if (!image->Initialize(pixmap.get(), gfx::BufferFormat::BGRA_8888)) 134 if (!image->Initialize(pixmap.get(), gfx::BufferFormat::BGRA_8888))
135 return false; 135 return false;
136 // GLImage must have Destroy() called before destructor is called. 136 // GLImage must have Destroy() called before destructor is called.
137 if (images_[i]) 137 if (images_[i])
138 images_[i]->Destroy(true); 138 images_[i]->Destroy(true);
139 images_[i] = image; 139 images_[i] = image;
140 // Bind image to texture. 140 // Bind image to texture.
141 gl::ScopedTextureBinder binder(GL_TEXTURE_2D, textures_[i]); 141 gl::ScopedTextureBinder binder(GL_TEXTURE_2D, textures_[i]);
142 if (!images_[i]->BindTexImage(GL_TEXTURE_2D)) 142 if (!images_[i]->BindTexImage(GL_TEXTURE_2D, nullptr))
143 return false; 143 return false;
144 } 144 }
145 return true; 145 return true;
146 } 146 }
147 147
148 } // namespace ui 148 } // namespace ui
OLDNEW
« ui/gl/gl_image.h ('K') | « ui/gl/test/gl_image_test_template.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698