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

Side by Side Diff: gpu/command_buffer/service/texture_definition.cc

Issue 1057183002: Fix a few lints found while working on crrev.com/1051503003. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More lints removed. "git cl format" reverted. Created 5 years, 8 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 "gpu/command_buffer/service/texture_definition.h" 5 #include "gpu/command_buffer/service/texture_definition.h"
6 6
7 #include <list> 7 #include <list>
8 8
9 #include "base/memory/linked_ptr.h" 9 #include "base/memory/linked_ptr.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 void RemoveClient(gfx::GLImage* client) override; 119 void RemoveClient(gfx::GLImage* client) override;
120 bool IsClient(gfx::GLImage* client) override; 120 bool IsClient(gfx::GLImage* client) override;
121 void BindToTexture(GLenum target) override; 121 void BindToTexture(GLenum target) override;
122 122
123 EGLDisplay egl_display_; 123 EGLDisplay egl_display_;
124 EGLImageKHR egl_image_; 124 EGLImageKHR egl_image_;
125 125
126 base::Lock lock_; 126 base::Lock lock_;
127 127
128 struct ClientInfo { 128 struct ClientInfo {
129 ClientInfo(gfx::GLImage* client); 129 explicit ClientInfo(gfx::GLImage* client);
130 ~ClientInfo(); 130 ~ClientInfo();
131 131
132 gfx::GLImage* client; 132 gfx::GLImage* client;
133 bool needs_wait_before_read; 133 bool needs_wait_before_read;
134 }; 134 };
135 std::list<ClientInfo> client_infos_; 135 std::list<ClientInfo> client_infos_;
136 gfx::GLImage* write_client_; 136 gfx::GLImage* write_client_;
137 137
138 DISALLOW_COPY_AND_ASSIGN(NativeImageBufferEGL); 138 DISALLOW_COPY_AND_ASSIGN(NativeImageBufferEGL);
139 }; 139 };
140 140
141 scoped_refptr<NativeImageBufferEGL> NativeImageBufferEGL::Create( 141 scoped_refptr<NativeImageBufferEGL> NativeImageBufferEGL::Create(
142 GLuint texture_id) { 142 GLuint texture_id) {
143 EGLDisplay egl_display = gfx::GLSurfaceEGL::GetHardwareDisplay(); 143 EGLDisplay egl_display = gfx::GLSurfaceEGL::GetHardwareDisplay();
144 EGLContext egl_context = eglGetCurrentContext(); 144 EGLContext egl_context = eglGetCurrentContext();
145 145
146 DCHECK_NE(EGL_NO_CONTEXT, egl_context); 146 DCHECK_NE(EGL_NO_CONTEXT, egl_context);
147 DCHECK_NE(EGL_NO_DISPLAY, egl_display); 147 DCHECK_NE(EGL_NO_DISPLAY, egl_display);
148 DCHECK(glIsTexture(texture_id)); 148 DCHECK(glIsTexture(texture_id));
149 149
150 DCHECK(gfx::g_driver_egl.ext.b_EGL_KHR_image_base && 150 DCHECK(gfx::g_driver_egl.ext.b_EGL_KHR_image_base &&
151 gfx::g_driver_egl.ext.b_EGL_KHR_gl_texture_2D_image && 151 gfx::g_driver_egl.ext.b_EGL_KHR_gl_texture_2D_image &&
152 gfx::g_driver_gl.ext.b_GL_OES_EGL_image); 152 gfx::g_driver_gl.ext.b_GL_OES_EGL_image);
153 153
154 const EGLint egl_attrib_list[] = { 154 const EGLint egl_attrib_list[] = {
155 EGL_GL_TEXTURE_LEVEL_KHR, 0, EGL_IMAGE_PRESERVED_KHR, EGL_TRUE, EGL_NONE}; 155 EGL_GL_TEXTURE_LEVEL_KHR, 0, EGL_IMAGE_PRESERVED_KHR, EGL_TRUE, EGL_NONE};
156 EGLClientBuffer egl_buffer = reinterpret_cast<EGLClientBuffer>(texture_id); 156 EGLClientBuffer egl_buffer = reinterpret_cast<EGLClientBuffer>(texture_id);
157 EGLenum egl_target = EGL_GL_TEXTURE_2D_KHR; // TODO 157 EGLenum egl_target = EGL_GL_TEXTURE_2D_KHR;
158 158
159 EGLImageKHR egl_image = eglCreateImageKHR( 159 EGLImageKHR egl_image = eglCreateImageKHR(
160 egl_display, egl_context, egl_target, egl_buffer, egl_attrib_list); 160 egl_display, egl_context, egl_target, egl_buffer, egl_attrib_list);
161 161
162 if (egl_image == EGL_NO_IMAGE_KHR) { 162 if (egl_image == EGL_NO_IMAGE_KHR) {
163 LOG(ERROR) << "eglCreateImageKHR for cross-thread sharing failed: 0x" 163 LOG(ERROR) << "eglCreateImageKHR for cross-thread sharing failed: 0x"
164 << std::hex << eglGetError(); 164 << std::hex << eglGetError();
165 return NULL; 165 return NULL;
166 } 166 }
167 167
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 417
418 return true; 418 return true;
419 } 419 }
420 420
421 bool TextureDefinition::SafeToRenderFrom() const { 421 bool TextureDefinition::SafeToRenderFrom() const {
422 return level_info_.cleared; 422 return level_info_.cleared;
423 } 423 }
424 424
425 } // namespace gles2 425 } // namespace gles2
426 } // namespace gpu 426 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/in_process_command_buffer.cc ('k') | gpu/command_buffer/service/texture_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698