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

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

Issue 2432413003: gpu, cmaa: add glApplyScreenSpaceAntialiasingCHROMIUM unittests (Closed)
Patch Set: Created 4 years, 2 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_decoder.h" 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h"
6 6
7 #include <limits.h> 7 #include <limits.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 #include <stdio.h> 10 #include <stdio.h>
(...skipping 16610 matching lines...) Expand 10 before | Expand all | Expand 10 after
16621 LOCAL_SET_GL_ERROR( 16621 LOCAL_SET_GL_ERROR(
16622 GL_INVALID_OPERATION, 16622 GL_INVALID_OPERATION,
16623 "glCreateAndConsumeTextureCHROMIUM", "invalid target"); 16623 "glCreateAndConsumeTextureCHROMIUM", "invalid target");
16624 return; 16624 return;
16625 } 16625 }
16626 16626
16627 texture_ref = texture_manager()->Consume(client_id, texture); 16627 texture_ref = texture_manager()->Consume(client_id, texture);
16628 } 16628 }
16629 16629
16630 void GLES2DecoderImpl::DoApplyScreenSpaceAntialiasingCHROMIUM() { 16630 void GLES2DecoderImpl::DoApplyScreenSpaceAntialiasingCHROMIUM() {
16631 if (!feature_info_->feature_flags().chromium_screen_space_antialiasing) {
16632 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION,
16633 "glApplyScreenSpaceAntialiasingCHROMIUM",
16634 "command not supported");
16635 return;
16636 }
16637
16638 Framebuffer* bound_framebuffer =
16639 GetFramebufferInfoForTarget(GL_DRAW_FRAMEBUFFER);
16640 if (!bound_framebuffer) {
16641 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION,
16642 "glApplyScreenSpaceAntialiasingCHROMIUM",
16643 "no bound framebuffer object");
16644 return;
16645 }
16646
16631 // Apply CMAA(Conservative Morphological Anti-Aliasing) algorithm to the 16647 // Apply CMAA(Conservative Morphological Anti-Aliasing) algorithm to the
16632 // color attachments of currently bound draw framebuffer. 16648 // color attachments of currently bound draw framebuffer.
16633 // Reference GL_INTEL_framebuffer_CMAA for details. 16649 // Reference GL_INTEL_framebuffer_CMAA for details.
16634 // Use platform version if available. 16650 // Use platform version if available.
16635 if (!feature_info_->feature_flags() 16651 if (!feature_info_->feature_flags()
16636 .use_chromium_screen_space_antialiasing_via_shaders) { 16652 .use_chromium_screen_space_antialiasing_via_shaders) {
16637 glApplyFramebufferAttachmentCMAAINTEL(); 16653 glApplyFramebufferAttachmentCMAAINTEL();
16638 } else { 16654 } else {
16639 // Defer initializing the CopyTextureCHROMIUMResourceManager until it is 16655 // Defer initializing the CopyTextureCHROMIUMResourceManager until it is
16640 // needed because it takes ??s of milliseconds to initialize. 16656 // needed because it takes ??s of milliseconds to initialize.
16641 if (!apply_framebuffer_attachment_cmaa_intel_.get()) { 16657 if (!apply_framebuffer_attachment_cmaa_intel_.get()) {
16642 LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER( 16658 LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER(
16643 "glApplyFramebufferAttachmentCMAAINTEL"); 16659 "glApplyFramebufferAttachmentCMAAINTEL");
16644 apply_framebuffer_attachment_cmaa_intel_.reset( 16660 apply_framebuffer_attachment_cmaa_intel_.reset(
16645 new ApplyFramebufferAttachmentCMAAINTELResourceManager()); 16661 new ApplyFramebufferAttachmentCMAAINTELResourceManager());
16646 apply_framebuffer_attachment_cmaa_intel_->Initialize(this); 16662 apply_framebuffer_attachment_cmaa_intel_->Initialize(this);
16647 RestoreCurrentFramebufferBindings(); 16663 RestoreCurrentFramebufferBindings();
16648 if (LOCAL_PEEK_GL_ERROR("glApplyFramebufferAttachmentCMAAINTEL") != 16664 if (LOCAL_PEEK_GL_ERROR("glApplyFramebufferAttachmentCMAAINTEL") !=
16649 GL_NO_ERROR) 16665 GL_NO_ERROR)
16650 return; 16666 return;
16651 } 16667 }
16652 apply_framebuffer_attachment_cmaa_intel_ 16668 apply_framebuffer_attachment_cmaa_intel_
16653 ->ApplyFramebufferAttachmentCMAAINTEL( 16669 ->ApplyFramebufferAttachmentCMAAINTEL(this, bound_framebuffer);
16654 this, GetFramebufferInfoForTarget(GL_DRAW_FRAMEBUFFER));
16655 } 16670 }
16656 } 16671 }
16657 16672
16658 void GLES2DecoderImpl::DoInsertEventMarkerEXT( 16673 void GLES2DecoderImpl::DoInsertEventMarkerEXT(
16659 GLsizei length, const GLchar* marker) { 16674 GLsizei length, const GLchar* marker) {
16660 if (!marker) { 16675 if (!marker) {
16661 marker = ""; 16676 marker = "";
16662 } 16677 }
16663 debug_marker_manager_.SetMarker( 16678 debug_marker_manager_.SetMarker(
16664 length ? std::string(marker, length) : std::string(marker)); 16679 length ? std::string(marker, length) : std::string(marker));
(...skipping 1852 matching lines...) Expand 10 before | Expand all | Expand 10 after
18517 } 18532 }
18518 18533
18519 // Include the auto-generated part of this file. We split this because it means 18534 // Include the auto-generated part of this file. We split this because it means
18520 // we can easily edit the non-auto generated parts right here in this file 18535 // we can easily edit the non-auto generated parts right here in this file
18521 // instead of having to edit some template or the code generator. 18536 // instead of having to edit some template or the code generator.
18522 #include "base/macros.h" 18537 #include "base/macros.h"
18523 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" 18538 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h"
18524 18539
18525 } // namespace gles2 18540 } // namespace gles2
18526 } // namespace gpu 18541 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698