OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "gpu/command_buffer/service/gles2_cmd_apply_framebuffer_attachment_cmaa _intel.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_apply_framebuffer_attachment_cmaa _intel.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "gpu/command_buffer/service/framebuffer_manager.h" | 8 #include "gpu/command_buffer/service/framebuffer_manager.h" |
9 #include "gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.h" | 9 #include "gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.h" |
10 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" | 10 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
11 #include "gpu/command_buffer/service/texture_manager.h" | |
11 #include "ui/gl/gl_context.h" | 12 #include "ui/gl/gl_context.h" |
12 #include "ui/gl/gl_gl_api_implementation.h" | 13 #include "ui/gl/gl_gl_api_implementation.h" |
13 #include "ui/gl/gl_version_info.h" | 14 #include "ui/gl/gl_version_info.h" |
14 | 15 |
15 #define SHADER(Src) #Src | 16 #define SHADER(Src) #Src |
16 | 17 |
17 namespace gpu { | 18 namespace gpu { |
18 namespace gles2 { | 19 namespace gles2 { |
19 | 20 |
20 ApplyFramebufferAttachmentCMAAINTELResourceManager:: | 21 ApplyFramebufferAttachmentCMAAINTELResourceManager:: |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
234 continue; | 235 continue; |
235 GLsizei width = attachment->width(); | 236 GLsizei width = attachment->width(); |
236 GLsizei height = attachment->height(); | 237 GLsizei height = attachment->height(); |
237 GLenum internal_format = attachment->internal_format(); | 238 GLenum internal_format = attachment->internal_format(); |
238 | 239 |
239 // Resize internal structures - only if needed. | 240 // Resize internal structures - only if needed. |
240 OnSize(width, height); | 241 OnSize(width, height); |
241 | 242 |
242 // CMAA internally expects GL_RGBA8 textures. | 243 // CMAA internally expects GL_RGBA8 textures. |
243 // Process using a GL_RGBA8 copy if this is not the case. | 244 // Process using a GL_RGBA8 copy if this is not the case. |
244 bool do_copy = internal_format != GL_RGBA8; | 245 const bool rgba_immutable = |
246 attachment->IsTextureAttachmentImmutable() && | |
piman
2016/12/02 20:36:46
Well, you already know you have a texture attachme
dshwang
2016/12/02 23:40:24
We cannot get TextureRef/Texture from Framebuffer:
piman
2016/12/05 20:07:08
attachment->object_name() gives you the client tex
dshwang
2016/12/09 03:23:27
Done. Thank you for educating :)
| |
247 TextureManager::ExtractFormatFromStorageFormat(internal_format) == | |
248 GL_RGBA; | |
249 const bool do_copy = !rgba_immutable; | |
245 | 250 |
246 // CMAA Effect | 251 // CMAA Effect |
247 if (do_copy) { | 252 if (do_copy) { |
248 ApplyCMAAEffectTexture(source_texture, rgba8_texture_, do_copy); | 253 ApplyCMAAEffectTexture(source_texture, rgba8_texture_, do_copy); |
249 | 254 |
250 copier->DoCopySubTexture( | 255 copier->DoCopySubTexture( |
251 decoder, GL_TEXTURE_2D, rgba8_texture_, GL_RGBA8, GL_TEXTURE_2D, | 256 decoder, GL_TEXTURE_2D, rgba8_texture_, GL_RGBA8, GL_TEXTURE_2D, |
252 source_texture, internal_format, 0, 0, 0, 0, width_, height_, | 257 source_texture, internal_format, 0, 0, 0, 0, width_, height_, |
253 width_, height_, width_, height_, false, false, false); | 258 width_, height_, width_, height_, false, false, false); |
254 } else { | 259 } else { |
(...skipping 1586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1841 \n#endif\n | 1846 \n#endif\n |
1842 \n#if defined DISPLAY_EDGES\n | 1847 \n#if defined DISPLAY_EDGES\n |
1843 DisplayEdges(); | 1848 DisplayEdges(); |
1844 \n#endif\n | 1849 \n#endif\n |
1845 } | 1850 } |
1846 ); | 1851 ); |
1847 /* clang-format on */ | 1852 /* clang-format on */ |
1848 | 1853 |
1849 } // namespace gles2 | 1854 } // namespace gles2 |
1850 } // namespace gpu | 1855 } // namespace gpu |
OLD | NEW |