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

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

Issue 2543123003: gpu, cmaa: improve |do_copy| condition logic (Closed)
Patch Set: use existing attachment->object_name() Created 4 years 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/gles2_cmd_apply_framebuffer_attachment_cmaa_intel.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_apply_framebuffer_attachment_cmaa_intel.cc b/gpu/command_buffer/service/gles2_cmd_apply_framebuffer_attachment_cmaa_intel.cc
index a8d5e4354b29a22f14c719c7f4176c9c64e9f366..adc469bb352ca09dacc3ff2680ae99806091bf8a 100644
--- a/gpu/command_buffer/service/gles2_cmd_apply_framebuffer_attachment_cmaa_intel.cc
+++ b/gpu/command_buffer/service/gles2_cmd_apply_framebuffer_attachment_cmaa_intel.cc
@@ -8,6 +8,7 @@
#include "gpu/command_buffer/service/framebuffer_manager.h"
#include "gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.h"
#include "gpu/command_buffer/service/gles2_cmd_decoder.h"
+#include "gpu/command_buffer/service/texture_manager.h"
#include "ui/gl/gl_context.h"
#include "ui/gl/gl_gl_api_implementation.h"
#include "ui/gl/gl_version_info.h"
@@ -207,9 +208,10 @@ void ApplyFramebufferAttachmentCMAAINTELResourceManager::Destroy() {
// Reference GL_INTEL_framebuffer_CMAA for details.
void ApplyFramebufferAttachmentCMAAINTELResourceManager::
ApplyFramebufferAttachmentCMAAINTEL(
- gles2::GLES2Decoder* decoder,
- gles2::Framebuffer* framebuffer,
- gles2::CopyTextureCHROMIUMResourceManager* copier) {
+ GLES2Decoder* decoder,
+ Framebuffer* framebuffer,
+ CopyTextureCHROMIUMResourceManager* copier,
+ TextureManager* texture_manager) {
DCHECK(decoder);
DCHECK(initialized_);
if (!framebuffer)
@@ -241,7 +243,14 @@ void ApplyFramebufferAttachmentCMAAINTELResourceManager::
// CMAA internally expects GL_RGBA8 textures.
// Process using a GL_RGBA8 copy if this is not the case.
- bool do_copy = internal_format != GL_RGBA8;
+ DCHECK(attachment->object_name());
+ TextureRef* texture =
+ texture_manager->GetTexture(attachment->object_name());
+ const bool rgba_immutable =
+ texture->texture()->IsImmutable() &&
+ TextureManager::ExtractFormatFromStorageFormat(internal_format) ==
+ GL_RGBA;
+ const bool do_copy = !rgba_immutable;
// CMAA Effect
if (do_copy) {

Powered by Google App Engine
This is Rietveld 408576698