StreamTextureAndroid: supports passthrough command decoder
Bug: 1172769,1174709 Change-Id: I0ee8ce06fac9e15a54ea3247d88c9304c84d5c03 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2676483 Reviewed-by: Vasiliy Telezhnikov <vasilyt@chromium.org> Commit-Queue: Peng Huang <penghuang@chromium.org> Cr-Commit-Position: refs/heads/master@{#851188}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
bd375b0c72
commit
2e658517ad
@ -14,6 +14,7 @@
|
|||||||
#include "gpu/command_buffer/common/shared_image_usage.h"
|
#include "gpu/command_buffer/common/shared_image_usage.h"
|
||||||
#include "gpu/command_buffer/service/abstract_texture_impl_shared_context_state.h"
|
#include "gpu/command_buffer/service/abstract_texture_impl_shared_context_state.h"
|
||||||
#include "gpu/command_buffer/service/context_state.h"
|
#include "gpu/command_buffer/service/context_state.h"
|
||||||
|
#include "gpu/command_buffer/service/feature_info.h"
|
||||||
#include "gpu/command_buffer/service/mailbox_manager.h"
|
#include "gpu/command_buffer/service/mailbox_manager.h"
|
||||||
#include "gpu/command_buffer/service/scheduler.h"
|
#include "gpu/command_buffer/service/scheduler.h"
|
||||||
#include "gpu/command_buffer/service/shared_context_state.h"
|
#include "gpu/command_buffer/service/shared_context_state.h"
|
||||||
@ -295,11 +296,21 @@ gpu::Mailbox StreamTexture::CreateSharedImage(const gfx::Size& coded_size) {
|
|||||||
// need to ensure that it gets updated here.
|
// need to ensure that it gets updated here.
|
||||||
|
|
||||||
auto scoped_make_current = MakeCurrent(context_state_.get());
|
auto scoped_make_current = MakeCurrent(context_state_.get());
|
||||||
auto legacy_mailbox_texture =
|
|
||||||
std::make_unique<gles2::AbstractTextureImplOnSharedContext>(
|
bool use_passthrough =
|
||||||
GL_TEXTURE_EXTERNAL_OES, GL_RGBA, coded_size.width(),
|
context_state_->feature_info()->is_passthrough_cmd_decoder();
|
||||||
coded_size.height(), 1, 0, GL_RGBA, GL_UNSIGNED_BYTE,
|
std::unique_ptr<gles2::AbstractTexture> legacy_mailbox_texture;
|
||||||
context_state_.get());
|
if (use_passthrough) {
|
||||||
|
legacy_mailbox_texture =
|
||||||
|
std::make_unique<gles2::AbstractTextureImplOnSharedContextPassthrough>(
|
||||||
|
GL_TEXTURE_EXTERNAL_OES, context_state_);
|
||||||
|
} else {
|
||||||
|
legacy_mailbox_texture =
|
||||||
|
std::make_unique<gles2::AbstractTextureImplOnSharedContext>(
|
||||||
|
GL_TEXTURE_EXTERNAL_OES, GL_RGBA, coded_size.width(),
|
||||||
|
coded_size.height(), 1, 0, GL_RGBA, GL_UNSIGNED_BYTE,
|
||||||
|
context_state_);
|
||||||
|
}
|
||||||
legacy_mailbox_texture->BindStreamTextureImage(
|
legacy_mailbox_texture->BindStreamTextureImage(
|
||||||
this, texture_owner_->GetTextureId());
|
this, texture_owner_->GetTextureId());
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user