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

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

Issue 180723023: gpu: Mailbox emulation with EGLImage (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: oops Created 6 years, 9 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/texture_manager.cc
diff --git a/gpu/command_buffer/service/texture_manager.cc b/gpu/command_buffer/service/texture_manager.cc
index 38516e7d49a7887c5685917a36fb585463ad9d1b..ef2cd49891b441023f4e90557afc783ca1187431 100644
--- a/gpu/command_buffer/service/texture_manager.cc
+++ b/gpu/command_buffer/service/texture_manager.cc
@@ -806,6 +806,11 @@ void Texture::SetLevelImage(
}
gfx::GLImage* Texture::GetLevelImage(GLint target, GLint level) const {
+ if (target != GL_TEXTURE_2D && target != GL_TEXTURE_EXTERNAL_OES &&
+ target != GL_TEXTURE_RECTANGLE_ARB) {
+ return NULL;
+ }
piman 2014/03/13 04:41:58 Won't that break cube maps?
no sievers 2014/03/13 20:50:15 I noticed recently that we actually don't support
+
size_t face_index = GLTargetToFaceIndex(target);
if (level >= 0 && face_index < level_infos_.size() &&
static_cast<size_t>(level) < level_infos_[face_index].size()) {
@@ -817,6 +822,17 @@ gfx::GLImage* Texture::GetLevelImage(GLint target, GLint level) const {
return 0;
}
+void Texture::OnWillModifyPixels() {
+ gfx::GLImage* image = GetLevelImage(target(), 0);
+ if (image)
+ image->WillModifyTexImage();
+}
+
+void Texture::OnDidModifyPixels() {
+ gfx::GLImage* image = GetLevelImage(target(), 0);
+ if (image)
+ image->DidModifyTexImage();
+}
TextureRef::TextureRef(TextureManager* manager,
GLuint client_id,

Powered by Google App Engine
This is Rietveld 408576698