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

Side by Side Diff: gpu/command_buffer/service/gles2_cmd_apply_framebuffer_attachment_cmaa_intel.cc

Issue 2695833003: Revert of Select correct copy method for DoCopySubTexture (Closed)
Patch Set: Created 3 years, 10 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 unified diff | Download patch
OLDNEW
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"
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 const bool rgba_immutable = 249 const bool rgba_immutable =
250 texture->texture()->IsImmutable() && 250 texture->texture()->IsImmutable() &&
251 TextureManager::ExtractFormatFromStorageFormat(internal_format) == 251 TextureManager::ExtractFormatFromStorageFormat(internal_format) ==
252 GL_RGBA; 252 GL_RGBA;
253 const bool do_copy = !rgba_immutable; 253 const bool do_copy = !rgba_immutable;
254 254
255 // CMAA Effect 255 // CMAA Effect
256 if (do_copy) { 256 if (do_copy) {
257 ApplyCMAAEffectTexture(source_texture, rgba8_texture_, do_copy); 257 ApplyCMAAEffectTexture(source_texture, rgba8_texture_, do_copy);
258 258
259 // Source format for DoCopySubTexture is always GL_RGBA8.
260 CopyTextureMethod method = DIRECT_COPY;
261 bool copy_tex_image_format_valid =
262 !GLES2Util::IsIntegerFormat(internal_format) &&
263 GLES2Util::GetColorEncodingFromInternalFormat(internal_format) !=
264 GL_SRGB &&
265 internal_format != GL_BGRA_EXT && internal_format != GL_BGRA8_EXT;
266 if (GLES2Util::IsSizedColorFormat(internal_format)) {
267 int dr, dg, db, da;
268 GLES2Util::GetColorFormatComponentSizes(internal_format, 0, &dr, &dg,
269 &db, &da);
270 if ((dr > 0 && dr != 8) || (dg > 0 && dg != 8) ||
271 (db > 0 && db != 8) || (da > 0 && da != 8)) {
272 copy_tex_image_format_valid = false;
273 }
274 }
275 if (!copy_tex_image_format_valid)
276 method = DIRECT_DRAW;
277 bool color_renderable = Texture::ColorRenderable(
278 decoder->GetFeatureInfo(), internal_format, false);
279 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY)
280 // glDrawArrays is faster than glCopyTexSubImage2D on IA Mesa driver,
281 // although opposite in Android.
282 // TODO(dshwang): After Mesa fixes this issue, remove this hack.
283 // https://bugs.freedesktop.org/show_bug.cgi?id=98478, crbug.com/535198.
284 if (color_renderable)
285 method = DIRECT_DRAW;
286 #endif
287 if (method == DIRECT_DRAW && !color_renderable)
288 method = DRAW_AND_COPY;
289
290 copier->DoCopySubTexture( 259 copier->DoCopySubTexture(
291 decoder, GL_TEXTURE_2D, rgba8_texture_, 0, GL_RGBA8, GL_TEXTURE_2D, 260 decoder, GL_TEXTURE_2D, rgba8_texture_, 0, GL_RGBA8, GL_TEXTURE_2D,
292 source_texture, 0, internal_format, 0, 0, 0, 0, width_, height_, 261 source_texture, 0, internal_format, 0, 0, 0, 0, width_, height_,
293 width_, height_, width_, height_, false, false, false, method); 262 width_, height_, width_, height_, false, false, false, DIRECT_DRAW);
294 } else { 263 } else {
295 ApplyCMAAEffectTexture(source_texture, source_texture, do_copy); 264 ApplyCMAAEffectTexture(source_texture, source_texture, do_copy);
296 } 265 }
297 266
298 decoder->RestoreTextureState(source_texture); 267 decoder->RestoreTextureState(source_texture);
299 } 268 }
300 } 269 }
301 270
302 // Restore state 271 // Restore state
303 decoder->RestoreAllAttributes(); 272 decoder->RestoreAllAttributes();
(...skipping 1577 matching lines...) Expand 10 before | Expand all | Expand 10 after
1881 \n#endif\n 1850 \n#endif\n
1882 \n#if defined DISPLAY_EDGES\n 1851 \n#if defined DISPLAY_EDGES\n
1883 DisplayEdges(); 1852 DisplayEdges();
1884 \n#endif\n 1853 \n#endif\n
1885 } 1854 }
1886 ); 1855 );
1887 /* clang-format on */ 1856 /* clang-format on */
1888 1857
1889 } // namespace gles2 1858 } // namespace gles2
1890 } // namespace gpu 1859 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/common/gles2_cmd_utils.cc ('k') | gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698