| OLD | NEW |
| 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 Loading... |
| 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 | |
| 16790 // Apply CMAA(Conservative Morphological Anti-Aliasing) algorithm to the | 16779 // Apply CMAA(Conservative Morphological Anti-Aliasing) algorithm to the |
| 16791 // color attachments of currently bound draw framebuffer. | 16780 // color attachments of currently bound draw framebuffer. |
| 16792 // Reference GL_INTEL_framebuffer_CMAA for details. | 16781 // Reference GL_INTEL_framebuffer_CMAA for details. |
| 16793 // Use platform version if available. | 16782 // Use platform version if available. |
| 16794 if (!feature_info_->feature_flags() | 16783 if (!feature_info_->feature_flags() |
| 16795 .use_chromium_screen_space_antialiasing_via_shaders) { | 16784 .use_chromium_screen_space_antialiasing_via_shaders) { |
| 16796 glApplyFramebufferAttachmentCMAAINTEL(); | 16785 glApplyFramebufferAttachmentCMAAINTEL(); |
| 16797 } else { | 16786 } else { |
| 16798 // Defer initializing the CopyTextureCHROMIUMResourceManager until it is | 16787 // Defer initializing the CopyTextureCHROMIUMResourceManager until it is |
| 16799 // needed because it takes ??s of milliseconds to initialize. | 16788 // needed because it takes ??s of milliseconds to initialize. |
| 16800 if (!apply_framebuffer_attachment_cmaa_intel_.get()) { | 16789 if (!apply_framebuffer_attachment_cmaa_intel_.get()) { |
| 16801 LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER( | 16790 LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER( |
| 16802 "glApplyFramebufferAttachmentCMAAINTEL"); | 16791 "glApplyFramebufferAttachmentCMAAINTEL"); |
| 16803 apply_framebuffer_attachment_cmaa_intel_.reset( | 16792 apply_framebuffer_attachment_cmaa_intel_.reset( |
| 16804 new ApplyFramebufferAttachmentCMAAINTELResourceManager()); | 16793 new ApplyFramebufferAttachmentCMAAINTELResourceManager()); |
| 16805 apply_framebuffer_attachment_cmaa_intel_->Initialize(this); | 16794 apply_framebuffer_attachment_cmaa_intel_->Initialize(this); |
| 16806 RestoreCurrentFramebufferBindings(); | 16795 RestoreCurrentFramebufferBindings(); |
| 16807 if (LOCAL_PEEK_GL_ERROR("glApplyFramebufferAttachmentCMAAINTEL") != | 16796 if (LOCAL_PEEK_GL_ERROR("glApplyFramebufferAttachmentCMAAINTEL") != |
| 16808 GL_NO_ERROR) | 16797 GL_NO_ERROR) |
| 16809 return; | 16798 return; |
| 16810 } | 16799 } |
| 16811 apply_framebuffer_attachment_cmaa_intel_ | 16800 apply_framebuffer_attachment_cmaa_intel_ |
| 16812 ->ApplyFramebufferAttachmentCMAAINTEL(this, bound_framebuffer); | 16801 ->ApplyFramebufferAttachmentCMAAINTEL( |
| 16802 this, GetFramebufferInfoForTarget(GL_DRAW_FRAMEBUFFER)); |
| 16813 } | 16803 } |
| 16814 } | 16804 } |
| 16815 | 16805 |
| 16816 void GLES2DecoderImpl::DoInsertEventMarkerEXT( | 16806 void GLES2DecoderImpl::DoInsertEventMarkerEXT( |
| 16817 GLsizei length, const GLchar* marker) { | 16807 GLsizei length, const GLchar* marker) { |
| 16818 if (!marker) { | 16808 if (!marker) { |
| 16819 marker = ""; | 16809 marker = ""; |
| 16820 } | 16810 } |
| 16821 debug_marker_manager_.SetMarker( | 16811 debug_marker_manager_.SetMarker( |
| 16822 length ? std::string(marker, length) : std::string(marker)); | 16812 length ? std::string(marker, length) : std::string(marker)); |
| (...skipping 1852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 18675 } | 18665 } |
| 18676 | 18666 |
| 18677 // Include the auto-generated part of this file. We split this because it means | 18667 // Include the auto-generated part of this file. We split this because it means |
| 18678 // we can easily edit the non-auto generated parts right here in this file | 18668 // we can easily edit the non-auto generated parts right here in this file |
| 18679 // instead of having to edit some template or the code generator. | 18669 // instead of having to edit some template or the code generator. |
| 18680 #include "base/macros.h" | 18670 #include "base/macros.h" |
| 18681 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 18671 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
| 18682 | 18672 |
| 18683 } // namespace gles2 | 18673 } // namespace gles2 |
| 18684 } // namespace gpu | 18674 } // namespace gpu |
| OLD | NEW |