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

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

Issue 2432413003: gpu, cmaa: add glApplyScreenSpaceAntialiasingCHROMIUM unittests (Closed)
Patch Set: fix linux_chromium_rel_ng Created 4 years, 1 month 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 16758 matching lines...) Expand 10 before | Expand all | Expand 10 after
16769 LOCAL_SET_GL_ERROR( 16769 LOCAL_SET_GL_ERROR(
16770 GL_INVALID_OPERATION, 16770 GL_INVALID_OPERATION,
16771 "glCreateAndConsumeTextureCHROMIUM", "invalid target"); 16771 "glCreateAndConsumeTextureCHROMIUM", "invalid target");
16772 return; 16772 return;
16773 } 16773 }
16774 16774
16775 texture_ref = texture_manager()->Consume(client_id, texture); 16775 texture_ref = texture_manager()->Consume(client_id, texture);
16776 } 16776 }
16777 16777
16778 void GLES2DecoderImpl::DoApplyScreenSpaceAntialiasingCHROMIUM() { 16778 void GLES2DecoderImpl::DoApplyScreenSpaceAntialiasingCHROMIUM() {
16779 Framebuffer* bound_framebuffer =
16780 GetFramebufferInfoForTarget(GL_DRAW_FRAMEBUFFER);
16781 // TODO(dshwang): support it even after glBindFrameBuffer(GL_FRAMEBUFFER, 0).
16782 // skia will need to render to the window. crbug.com/656618
16783 if (!bound_framebuffer) {
16784 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION,
16785 "glApplyScreenSpaceAntialiasingCHROMIUM",
16786 "no bound framebuffer object");
16787 return;
16788 }
16789
16779 // Apply CMAA(Conservative Morphological Anti-Aliasing) algorithm to the 16790 // Apply CMAA(Conservative Morphological Anti-Aliasing) algorithm to the
16780 // color attachments of currently bound draw framebuffer. 16791 // color attachments of currently bound draw framebuffer.
16781 // Reference GL_INTEL_framebuffer_CMAA for details. 16792 // Reference GL_INTEL_framebuffer_CMAA for details.
16782 // Use platform version if available. 16793 // Use platform version if available.
16783 if (!feature_info_->feature_flags() 16794 if (!feature_info_->feature_flags()
16784 .use_chromium_screen_space_antialiasing_via_shaders) { 16795 .use_chromium_screen_space_antialiasing_via_shaders) {
16785 glApplyFramebufferAttachmentCMAAINTEL(); 16796 glApplyFramebufferAttachmentCMAAINTEL();
16786 } else { 16797 } else {
16787 // Defer initializing the CopyTextureCHROMIUMResourceManager until it is 16798 // Defer initializing the CopyTextureCHROMIUMResourceManager until it is
16788 // needed because it takes ??s of milliseconds to initialize. 16799 // needed because it takes ??s of milliseconds to initialize.
16789 if (!apply_framebuffer_attachment_cmaa_intel_.get()) { 16800 if (!apply_framebuffer_attachment_cmaa_intel_.get()) {
16790 LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER( 16801 LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER(
16791 "glApplyFramebufferAttachmentCMAAINTEL"); 16802 "glApplyFramebufferAttachmentCMAAINTEL");
16792 apply_framebuffer_attachment_cmaa_intel_.reset( 16803 apply_framebuffer_attachment_cmaa_intel_.reset(
16793 new ApplyFramebufferAttachmentCMAAINTELResourceManager()); 16804 new ApplyFramebufferAttachmentCMAAINTELResourceManager());
16794 apply_framebuffer_attachment_cmaa_intel_->Initialize(this); 16805 apply_framebuffer_attachment_cmaa_intel_->Initialize(this);
16795 RestoreCurrentFramebufferBindings(); 16806 RestoreCurrentFramebufferBindings();
16796 if (LOCAL_PEEK_GL_ERROR("glApplyFramebufferAttachmentCMAAINTEL") != 16807 if (LOCAL_PEEK_GL_ERROR("glApplyFramebufferAttachmentCMAAINTEL") !=
16797 GL_NO_ERROR) 16808 GL_NO_ERROR)
16798 return; 16809 return;
16799 } 16810 }
16800 apply_framebuffer_attachment_cmaa_intel_ 16811 apply_framebuffer_attachment_cmaa_intel_
16801 ->ApplyFramebufferAttachmentCMAAINTEL( 16812 ->ApplyFramebufferAttachmentCMAAINTEL(this, bound_framebuffer);
16802 this, GetFramebufferInfoForTarget(GL_DRAW_FRAMEBUFFER));
16803 } 16813 }
16804 } 16814 }
16805 16815
16806 void GLES2DecoderImpl::DoInsertEventMarkerEXT( 16816 void GLES2DecoderImpl::DoInsertEventMarkerEXT(
16807 GLsizei length, const GLchar* marker) { 16817 GLsizei length, const GLchar* marker) {
16808 if (!marker) { 16818 if (!marker) {
16809 marker = ""; 16819 marker = "";
16810 } 16820 }
16811 debug_marker_manager_.SetMarker( 16821 debug_marker_manager_.SetMarker(
16812 length ? std::string(marker, length) : std::string(marker)); 16822 length ? std::string(marker, length) : std::string(marker));
(...skipping 1852 matching lines...) Expand 10 before | Expand all | Expand 10 after
18665 } 18675 }
18666 18676
18667 // Include the auto-generated part of this file. We split this because it means 18677 // Include the auto-generated part of this file. We split this because it means
18668 // we can easily edit the non-auto generated parts right here in this file 18678 // we can easily edit the non-auto generated parts right here in this file
18669 // instead of having to edit some template or the code generator. 18679 // instead of having to edit some template or the code generator.
18670 #include "base/macros.h" 18680 #include "base/macros.h"
18671 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" 18681 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h"
18672 18682
18673 } // namespace gles2 18683 } // namespace gles2
18674 } // namespace gpu 18684 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698