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

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

Issue 890453002: Correctly track texture cleared state when sharing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: blank line Created 5 years, 11 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
« no previous file with comments | « gpu/command_buffer/service/texture_definition.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/texture_definition.cc
diff --git a/gpu/command_buffer/service/texture_definition.cc b/gpu/command_buffer/service/texture_definition.cc
index edd42717d3702ba9b421d5ba87ae79549ca11377..3d8f6704847f8b1e20f8da0c1e292d9bae265008 100644
--- a/gpu/command_buffer/service/texture_definition.cc
+++ b/gpu/command_buffer/service/texture_definition.cc
@@ -413,7 +413,8 @@ bool TextureDefinition::Matches(const Texture* texture) const {
if (texture->min_filter_ != min_filter_ ||
texture->mag_filter_ != mag_filter_ ||
texture->wrap_s_ != wrap_s_ ||
- texture->wrap_t_ != wrap_t_) {
+ texture->wrap_t_ != wrap_t_ ||
+ texture->SafeToRenderFrom() != SafeToRenderFrom()) {
return false;
}
@@ -424,5 +425,17 @@ bool TextureDefinition::Matches(const Texture* texture) const {
return true;
}
+bool TextureDefinition::SafeToRenderFrom() const {
+ for (size_t i = 0; i < level_infos_.size(); i++) {
+ const std::vector<LevelInfo>& face_info = level_infos_[i];
+ for (size_t j = 0; j < face_info.size(); ++j) {
no sievers 2015/01/29 20:23:49 for (const std::vector<LevelInfo>& face_info : lev
boliu 2015/01/29 22:04:34 Done. c++11 all the way!
+ if (!face_info[j].cleared) {
+ return false;
+ }
+ }
+ }
+ return true;
+}
+
} // namespace gles2
} // namespace gpu
« no previous file with comments | « gpu/command_buffer/service/texture_definition.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698