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

Unified Diff: gpu/command_buffer/service/stream_texture_manager_in_process_android.cc

Issue 1418603002: Revert of Re-land: ui: Move GLImage::BindTexImage fallback from GLImage implementations to GLES2CmdDecoder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/service/stream_texture_manager_in_process_android.cc
diff --git a/gpu/command_buffer/service/stream_texture_manager_in_process_android.cc b/gpu/command_buffer/service/stream_texture_manager_in_process_android.cc
index 0883f75f99a7f2cdba74f36bf5db128a9ef61460..e7e3a1f55a5ceaa00d71782631dc2104dfeb1510 100644
--- a/gpu/command_buffer/service/stream_texture_manager_in_process_android.cc
+++ b/gpu/command_buffer/service/stream_texture_manager_in_process_android.cc
@@ -19,9 +19,7 @@
// Simply wraps a SurfaceTexture reference as a GLImage.
class GLImageImpl : public gfx::GLImage {
public:
- GLImageImpl(uint32 texture_id,
- gles2::TextureManager* texture_manager,
- const scoped_refptr<gfx::SurfaceTexture>& surface_texture,
+ GLImageImpl(const scoped_refptr<gfx::SurfaceTexture>& surface_texture,
const base::Closure& release_callback);
// implement gfx::GLImage
@@ -30,10 +28,13 @@
unsigned GetInternalFormat() override;
bool BindTexImage(unsigned target) override;
void ReleaseTexImage(unsigned target) override;
- bool CopyTexImage(unsigned target) override;
bool CopyTexSubImage(unsigned target,
const gfx::Point& offset,
const gfx::Rect& rect) override;
+ void WillUseTexImage() override;
+ void DidUseTexImage() override {}
+ void WillModifyTexImage() override {}
+ void DidModifyTexImage() override {}
bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget,
int z_order,
gfx::OverlayTransform transform,
@@ -46,8 +47,6 @@
private:
~GLImageImpl() override;
- uint32 texture_id_;
- gles2::TextureManager* texture_manager_;
scoped_refptr<gfx::SurfaceTexture> surface_texture_;
base::Closure release_callback_;
@@ -55,14 +54,9 @@
};
GLImageImpl::GLImageImpl(
- uint32 texture_id,
- gles2::TextureManager* texture_manager,
const scoped_refptr<gfx::SurfaceTexture>& surface_texture,
const base::Closure& release_callback)
- : texture_id_(texture_id),
- texture_manager_(texture_manager),
- surface_texture_(surface_texture),
- release_callback_(release_callback) {}
+ : surface_texture_(surface_texture), release_callback_(release_callback) {}
GLImageImpl::~GLImageImpl() {
release_callback_.Run();
@@ -89,25 +83,14 @@
NOTREACHED();
}
-bool GLImageImpl::CopyTexImage(unsigned target) {
- surface_texture_->UpdateTexImage();
-
- gles2::Texture* texture =
- texture_manager_->GetTextureForServiceId(texture_id_);
- if (texture) {
- // By setting image state to UNBOUND instead of COPIED we ensure that
- // CopyTexImage() is called each time the surface texture is used for
- // drawing.
- texture->SetLevelImage(GL_TEXTURE_EXTERNAL_OES, 0, this,
- gles2::Texture::UNBOUND);
- }
- return true;
-}
-
bool GLImageImpl::CopyTexSubImage(unsigned target,
const gfx::Point& offset,
const gfx::Rect& rect) {
return false;
+}
+
+void GLImageImpl::WillUseTexImage() {
+ surface_texture_->UpdateTexImage();
}
bool GLImageImpl::ScheduleOverlayPlane(gfx::AcceleratedWidget widget,
@@ -156,17 +139,16 @@
base::Closure release_callback =
base::Bind(&StreamTextureManagerInProcess::OnReleaseStreamTexture,
weak_factory_.GetWeakPtr(), stream_id);
- scoped_refptr<gfx::GLImage> gl_image(
- new GLImageImpl(texture->service_id(), texture_manager, surface_texture,
- release_callback));
+ scoped_refptr<gfx::GLImage> gl_image(new GLImageImpl(surface_texture,
+ release_callback));
gfx::Size size = gl_image->GetSize();
texture_manager->SetTarget(texture, GL_TEXTURE_EXTERNAL_OES);
texture_manager->SetLevelInfo(texture, GL_TEXTURE_EXTERNAL_OES, 0, GL_RGBA,
size.width(), size.height(), 1, 0, GL_RGBA,
GL_UNSIGNED_BYTE, gfx::Rect(size));
- texture_manager->SetLevelImage(texture, GL_TEXTURE_EXTERNAL_OES, 0,
- gl_image.get(), gles2::Texture::UNBOUND);
+ texture_manager->SetLevelImage(
+ texture, GL_TEXTURE_EXTERNAL_OES, 0, gl_image.get());
{
base::AutoLock lock(map_lock_);
« no previous file with comments | « gpu/command_buffer/service/mailbox_manager_sync.cc ('k') | gpu/command_buffer/service/texture_definition.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698