summaryrefslogtreecommitdiffstats
path: root/gpu
diff options
context:
space:
mode:
authorpiman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-01 00:13:42 +0000
committerpiman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-01 00:13:42 +0000
commit95e44916f3b14a2a6d6e44e42604007bb1de9da7 (patch)
tree89e13ccdac6c950760a35731851d1c020e74fd25 /gpu
parent8f1afe957dd123368f410c18955cd8d73ea8c228 (diff)
downloadchromium_src-95e44916f3b14a2a6d6e44e42604007bb1de9da7.zip
chromium_src-95e44916f3b14a2a6d6e44e42604007bb1de9da7.tar.gz
chromium_src-95e44916f3b14a2a6d6e44e42604007bb1de9da7.tar.bz2
gpu: also move tex parameters into mailbox
Because the texture completeness depends on the filtering and wrapping modes, it's awkward to move image data into the mailbox but not parameters. BUG=None Review URL: https://chromiumcodereview.appspot.com/11414091 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@170609 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu')
-rw-r--r--gpu/GLES2/extensions/CHROMIUM/CHROMIUM_texture_mailbox.txt23
-rw-r--r--gpu/command_buffer/service/texture_definition.cc10
-rw-r--r--gpu/command_buffer/service/texture_definition.h15
-rw-r--r--gpu/command_buffer/service/texture_manager.cc10
4 files changed, 46 insertions, 12 deletions
diff --git a/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_texture_mailbox.txt b/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_texture_mailbox.txt
index 5a0a358..7159e64 100644
--- a/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_texture_mailbox.txt
+++ b/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_texture_mailbox.txt
@@ -38,13 +38,13 @@ New Procedures and Functions
void glProduceTextureCHROMIUM (GLenum target, const GLbyte *mailbox)
- Moves the image data of the currently bound texture object into the mailbox.
- The texture object is redefined as though all its levels had been resized to
- zero by zero and the texture object is therefore incomplete. If the mailbox
- previously contained image data, the old image data is deleted. The state
- of the bound texture object is not saved in the mailbox, only the image
- data, as well as the immutable state. The texture object is no longer
- immutable.
+ Moves the image data and parameters of the currently bound texture object
+ into the mailbox. The texture object is redefined as though all its levels
+ had been resized to zero by zero and the texture object is therefore
+ incomplete. If the mailbox previously contained image data, the old image
+ data is deleted. The state of the bound texture object is not saved in the
+ mailbox, only the image data, as well as the immutable state. The texture
+ object is no longer immutable.
If glProduceTextureCHROMIUM generates an error, the associated image data
is preserved in the texture object.
@@ -73,11 +73,10 @@ New Procedures and Functions
<mailbox> identifies a GL_MAILBOX_SIZE_CHROMIUM byte sized name returned by
glGenMailboxCHROMIUM.
- Redefines the image data of the currently bound texture object with the
- image data in the mailbox and empties the mailbox. The state of the
- currently bound texture object is not modified, only the image data. All
- levels are redefined, and the immutable state is set according to the
- contents of the mailbox.
+ Redefines the image data and parameters of the currently bound texture
+ object with the image data and parameters in the mailbox and empties the
+ mailbox. All levels are redefined, and the immutable state is set according
+ to the contents of the mailbox.
If glConsumeTextureCHROMIUM generates an error, the associated image data
is preserved in the texture object.
diff --git a/gpu/command_buffer/service/texture_definition.cc b/gpu/command_buffer/service/texture_definition.cc
index 098584f..aba0dfa 100644
--- a/gpu/command_buffer/service/texture_definition.cc
+++ b/gpu/command_buffer/service/texture_definition.cc
@@ -29,10 +29,20 @@ TextureDefinition::LevelInfo::LevelInfo(GLenum target,
TextureDefinition::TextureDefinition(GLenum target,
GLuint service_id,
+ GLenum min_filter,
+ GLenum mag_filter,
+ GLenum wrap_s,
+ GLenum wrap_t,
+ GLenum usage,
bool immutable,
const LevelInfos& level_infos)
: target_(target),
service_id_(service_id),
+ min_filter_(min_filter),
+ mag_filter_(mag_filter),
+ wrap_s_(wrap_s),
+ wrap_t_(wrap_t),
+ usage_(usage),
immutable_(immutable),
level_infos_(level_infos) {
}
diff --git a/gpu/command_buffer/service/texture_definition.h b/gpu/command_buffer/service/texture_definition.h
index 9ea9357..0a9910b 100644
--- a/gpu/command_buffer/service/texture_definition.h
+++ b/gpu/command_buffer/service/texture_definition.h
@@ -46,6 +46,11 @@ class GPU_EXPORT TextureDefinition {
TextureDefinition(GLenum target,
GLuint service_id,
+ GLenum min_filter,
+ GLenum mag_filter,
+ GLenum wrap_s,
+ GLenum wrap_t,
+ GLenum usage,
bool immutable,
const LevelInfos& level_infos);
~TextureDefinition();
@@ -55,6 +60,11 @@ class GPU_EXPORT TextureDefinition {
}
GLuint ReleaseServiceId();
+ GLenum min_filter() const { return min_filter_; }
+ GLenum mag_filter() const { return mag_filter_; }
+ GLenum wrap_s() const { return wrap_s_; }
+ GLenum wrap_t() const { return wrap_t_; }
+ GLenum usage() const { return usage_; }
bool immutable() const { return immutable_; }
@@ -65,6 +75,11 @@ class GPU_EXPORT TextureDefinition {
private:
GLenum target_;
GLuint service_id_;
+ GLenum min_filter_;
+ GLenum mag_filter_;
+ GLenum wrap_s_;
+ GLenum wrap_t_;
+ GLenum usage_;
bool immutable_;
std::vector<std::vector<LevelInfo> > level_infos_;
diff --git a/gpu/command_buffer/service/texture_manager.cc b/gpu/command_buffer/service/texture_manager.cc
index 8573f33..3627582 100644
--- a/gpu/command_buffer/service/texture_manager.cc
+++ b/gpu/command_buffer/service/texture_manager.cc
@@ -968,6 +968,11 @@ TextureDefinition* TextureManager::Save(TextureInfo* info) {
return new TextureDefinition(info->target(),
old_service_id,
+ info->min_filter(),
+ info->mag_filter(),
+ info->wrap_s(),
+ info->wrap_t(),
+ info->usage(),
immutable,
level_infos);
}
@@ -1014,6 +1019,11 @@ bool TextureManager::Restore(TextureInfo* info,
glDeleteTextures(1, &old_service_id);
info->SetServiceId(definition->ReleaseServiceId());
info->SetImmutable(definition->immutable());
+ SetParameter(info, GL_TEXTURE_MIN_FILTER, definition->min_filter());
+ SetParameter(info, GL_TEXTURE_MAG_FILTER, definition->mag_filter());
+ SetParameter(info, GL_TEXTURE_WRAP_S, definition->wrap_s());
+ SetParameter(info, GL_TEXTURE_WRAP_T, definition->wrap_t());
+ SetParameter(info, GL_TEXTURE_USAGE_ANGLE, definition->usage());
return true;
}