| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "content/common/gpu/media/avda_codec_image.h" | 5 #include "content/common/gpu/media/avda_codec_image.h" |
| 6 | 6 |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include "base/metrics/histogram_macros.h" | 9 #include "base/metrics/histogram_macros.h" |
| 10 #include "content/common/gpu/media/avda_shared_state.h" | 10 #include "content/common/gpu/media/avda_shared_state.h" |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 texture_ = texture; | 177 texture_ = texture; |
| 178 } | 178 } |
| 179 | 179 |
| 180 void AVDACodecImage::AttachSurfaceTextureToContext() { | 180 void AVDACodecImage::AttachSurfaceTextureToContext() { |
| 181 DCHECK(surface_texture_); | 181 DCHECK(surface_texture_); |
| 182 | 182 |
| 183 // We assume that the currently bound texture is the intended one. | 183 // We assume that the currently bound texture is the intended one. |
| 184 | 184 |
| 185 // Attach the surface texture to the first context we're bound on, so that | 185 // Attach the surface texture to the first context we're bound on, so that |
| 186 // no context switch is needed later. | 186 // no context switch is needed later. |
| 187 glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MAG_FILTER, GL_NEAREST); | 187 glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MAG_FILTER, GL_LINEAR); |
| 188 glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MIN_FILTER, GL_NEAREST); | 188 glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MIN_FILTER, GL_LINEAR); |
| 189 glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); | 189 glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); |
| 190 glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); | 190 glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); |
| 191 | 191 |
| 192 // The surface texture is already detached, so just attach it. | 192 // The surface texture is already detached, so just attach it. |
| 193 // We could do this earlier, but SurfaceTexture has context affinity, and we | 193 // We could do this earlier, but SurfaceTexture has context affinity, and we |
| 194 // don't want to require a context switch. | 194 // don't want to require a context switch. |
| 195 surface_texture_->AttachToGLContext(); | 195 surface_texture_->AttachToGLContext(); |
| 196 shared_state_->DidAttachSurfaceTexture(); | 196 shared_state_->DidAttachSurfaceTexture(); |
| 197 } | 197 } |
| 198 | 198 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 } | 231 } |
| 232 | 232 |
| 233 memcpy(matrix, gl_matrix_, sizeof(gl_matrix_)); | 233 memcpy(matrix, gl_matrix_, sizeof(gl_matrix_)); |
| 234 } | 234 } |
| 235 | 235 |
| 236 bool AVDACodecImage::IsCodecBufferOutstanding() const { | 236 bool AVDACodecImage::IsCodecBufferOutstanding() const { |
| 237 return codec_buffer_index_ != kInvalidCodecBufferIndex && media_codec_; | 237 return codec_buffer_index_ != kInvalidCodecBufferIndex && media_codec_; |
| 238 } | 238 } |
| 239 | 239 |
| 240 } // namespace content | 240 } // namespace content |
| OLD | NEW |