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

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

Issue 1870483003: Add command buffer support for GL_RGB CHROMIUM image emulation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments from piman. Rebase. Created 4 years, 8 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 8297c6d04556fbdee6806487b6a81552810637e3..265a47a4efac69d20597856da638afea21df1ef1 100644
--- a/gpu/command_buffer/service/texture_manager.cc
+++ b/gpu/command_buffer/service/texture_manager.cc
@@ -376,7 +376,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_)
@@ -866,6 +867,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;
+ return;
+ }
+ }
+ emulating_rgb_ = false;
+}
+
+
void Texture::IncAllFramebufferStateChangeCount() {
for (RefSet::iterator it = refs_.begin(); it != refs_.end(); ++it)
(*it)->manager()->IncFramebufferStateChangeCount();
@@ -1445,6 +1458,7 @@ void Texture::SetLevelImageInternal(GLenum target,
UpdateCanRenderCondition();
UpdateHasImages();
+ UpdateEmulatingRGB();
}
void Texture::SetLevelImage(GLenum target,
@@ -1621,6 +1635,10 @@ void Texture::ApplyFormatWorkarounds(FeatureInfo* feature_info) {
}
}
+bool Texture::EmulatingRGB() {
+ return emulating_rgb_;
+}
+
TextureRef::TextureRef(TextureManager* manager,
GLuint client_id,
Texture* texture)

Powered by Google App Engine
This is Rietveld 408576698