Chromium Code Reviews| 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 8297c6d04556fbdee6806487b6a81552810637e3..e33093dacab41b6d998300f1dfdb9f9f4f60b699 100644 |
| --- a/gpu/command_buffer/service/texture_manager.cc |
| +++ b/gpu/command_buffer/service/texture_manager.cc |
| @@ -65,6 +65,7 @@ struct TextureSignature { |
| bool can_render_; |
| bool can_render_to_; |
| bool npot_; |
| + bool emulating_rgb_; |
| // Since we will be hashing this signature structure, the padding must be |
| // zero initialized. Although the C++11 specifications specify that this is |
| @@ -86,7 +87,8 @@ struct TextureSignature { |
| bool has_image, |
| bool can_render, |
| bool can_render_to, |
| - bool npot) { |
| + bool npot, |
| + bool emulating_rgb) { |
| memset(this, 0, sizeof(TextureSignature)); |
| target_ = target; |
| level_ = level; |
| @@ -113,6 +115,7 @@ struct TextureSignature { |
| can_render_ = can_render; |
| can_render_to_ = can_render_to; |
| npot_ = npot; |
| + emulating_rgb_ = emulating_rgb; |
| } |
| }; |
| @@ -376,7 +379,8 @@ Texture::Texture(GLuint service_id) |
| estimated_size_(0), |
| can_render_condition_(CAN_RENDER_ALWAYS), |
| texture_max_anisotropy_initialized_(false), |
| - compatibility_swizzle_(nullptr) {} |
| + compatibility_swizzle_(nullptr), |
| + emulating_rgb_(false) {} |
| Texture::~Texture() { |
| if (mailbox_manager_) |
| @@ -587,7 +591,8 @@ void Texture::AddToSignature( |
| info.image.get() != NULL, |
| CanRender(feature_info), |
| CanRenderTo(feature_info, level), |
| - npot_); |
| + npot_, |
| + emulating_rgb_); |
| signature->append(TextureTag, sizeof(TextureTag)); |
| signature->append(reinterpret_cast<const char*>(&signature_data), |
| @@ -866,6 +871,18 @@ void Texture::UpdateHasImages() { |
| (*it)->manager()->UpdateNumImages(delta); |
| } |
| +void Texture::UpdateEmulatingRGB() { |
| + for (const FaceInfo& face_info : face_infos_) { |
| + for (const LevelInfo& level_info : face_info.level_infos) { |
| + if (level_info.image && level_info.image->EmulatingRGB()) |
| + emulating_rgb_ = true; |
|
erikchen
2016/04/15 18:54:07
piman: Request for comment.
This code is never ru
piman
2016/04/15 19:20:24
Why is this not run on non-mac platforms? Is it be
|
| + return; |
| + } |
| + } |
| + emulating_rgb_ = false; |
| +} |
| + |
| + |
| void Texture::IncAllFramebufferStateChangeCount() { |
| for (RefSet::iterator it = refs_.begin(); it != refs_.end(); ++it) |
| (*it)->manager()->IncFramebufferStateChangeCount(); |
| @@ -1445,6 +1462,7 @@ void Texture::SetLevelImageInternal(GLenum target, |
| UpdateCanRenderCondition(); |
| UpdateHasImages(); |
| + UpdateEmulatingRGB(); |
| } |
| void Texture::SetLevelImage(GLenum target, |
| @@ -1621,6 +1639,10 @@ void Texture::ApplyFormatWorkarounds(FeatureInfo* feature_info) { |
| } |
| } |
| +bool Texture::EmulatingRGB() { |
| + return emulating_rgb_; |
| +} |
| + |
| TextureRef::TextureRef(TextureManager* manager, |
| GLuint client_id, |
| Texture* texture) |