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

Side by Side Diff: media/gpu/avda_codec_image.cc

Issue 2014313002: StreamTextureImages can now override a Texture's service id (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added another test Created 4 years, 6 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 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 "media/gpu/avda_codec_image.h" 5 #include "media/gpu/avda_codec_image.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 // Make sure that we have the right image in the front buffer. Note that the 77 // Make sure that we have the right image in the front buffer. Note that the
78 // bound_service_id is guaranteed to be equal to the surface texture's client 78 // bound_service_id is guaranteed to be equal to the surface texture's client
79 // texture id, so we can skip preserving it if the right context is current. 79 // texture id, so we can skip preserving it if the right context is current.
80 UpdateSurfaceInternal(UpdateMode::RENDER_TO_FRONT_BUFFER, 80 UpdateSurfaceInternal(UpdateMode::RENDER_TO_FRONT_BUFFER,
81 kDontRestoreBindings); 81 kDontRestoreBindings);
82 82
83 // By setting image state to UNBOUND instead of COPIED we ensure that 83 // By setting image state to UNBOUND instead of COPIED we ensure that
84 // CopyTexImage() is called each time the surface texture is used for drawing. 84 // CopyTexImage() is called each time the surface texture is used for drawing.
85 // It would be nice if we could do this via asking for the currently bound 85 // It would be nice if we could do this via asking for the currently bound
86 // Texture, but the active unit never seems to change. 86 // Texture, but the active unit never seems to change.
87 texture_->SetLevelStreamTextureImage(GL_TEXTURE_EXTERNAL_OES, 0, this, 87 texture_->SetLevelImage(GL_TEXTURE_EXTERNAL_OES, 0, this,
88 gpu::gles2::Texture::UNBOUND); 88 gpu::gles2::Texture::UNBOUND);
89 89
90 return true; 90 return true;
91 } 91 }
92 92
93 bool AVDACodecImage::CopyTexSubImage(unsigned target, 93 bool AVDACodecImage::CopyTexSubImage(unsigned target,
94 const gfx::Point& offset, 94 const gfx::Point& offset,
95 const gfx::Rect& rect) { 95 const gfx::Rect& rect) {
96 return false; 96 return false;
97 } 97 }
98 98
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 } 235 }
236 236
237 bool AVDACodecImage::IsCodecBufferOutstanding() const { 237 bool AVDACodecImage::IsCodecBufferOutstanding() const {
238 static_assert(kUpdateOnly < 0 && kUpdateOnly > kRendered && 238 static_assert(kUpdateOnly < 0 && kUpdateOnly > kRendered &&
239 kRendered > kInvalidCodecBufferIndex, 239 kRendered > kInvalidCodecBufferIndex,
240 "Codec buffer index enum values are not ordered correctly."); 240 "Codec buffer index enum values are not ordered correctly.");
241 return codec_buffer_index_ > kRendered && media_codec_; 241 return codec_buffer_index_ > kRendered && media_codec_;
242 } 242 }
243 243
244 } // namespace media 244 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698