Chromium Code Reviews| 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 #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_APPLY_FRAMEBUFFER_ATTACHMENT_CMAA_I NTEL_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_APPLY_FRAMEBUFFER_ATTACHMENT_CMAA_I NTEL_H_ |
| 6 #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_APPLY_FRAMEBUFFER_ATTACHMENT_CMAA_I NTEL_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_APPLY_FRAMEBUFFER_ATTACHMENT_CMAA_I NTEL_H_ |
| 7 | 7 |
| 8 #include "gpu/command_buffer/service/gl_utils.h" | 8 #include "gpu/command_buffer/service/gl_utils.h" |
| 9 #include "gpu/gpu_export.h" | 9 #include "gpu/gpu_export.h" |
| 10 | 10 |
| 11 namespace gpu { | 11 namespace gpu { |
| 12 namespace gles2 { | 12 namespace gles2 { |
| 13 class CopyTextureCHROMIUMResourceManager; | 13 class CopyTextureCHROMIUMResourceManager; |
| 14 class GLES2Decoder; | 14 class GLES2Decoder; |
| 15 class Framebuffer; | 15 class Framebuffer; |
| 16 class TextureManager; | |
| 16 | 17 |
| 17 // This class encapsulates the resources required to implement the | 18 // This class encapsulates the resources required to implement the |
| 18 // GL_INTEL_framebuffer_CMAA extension via shaders. | 19 // GL_INTEL_framebuffer_CMAA extension via shaders. |
| 19 // | 20 // |
| 20 // The CMAA Conservative Morphological Anti-Aliasing) algorithm is applied to | 21 // The CMAA Conservative Morphological Anti-Aliasing) algorithm is applied to |
| 21 // all color attachments of the currently bound draw framebuffer. | 22 // all color attachments of the currently bound draw framebuffer. |
| 22 // | 23 // |
| 23 // Reference GL_INTEL_framebuffer_CMAA for details. | 24 // Reference GL_INTEL_framebuffer_CMAA for details. |
| 24 class GPU_EXPORT ApplyFramebufferAttachmentCMAAINTELResourceManager { | 25 class GPU_EXPORT ApplyFramebufferAttachmentCMAAINTELResourceManager { |
| 25 public: | 26 public: |
| 26 ApplyFramebufferAttachmentCMAAINTELResourceManager(); | 27 ApplyFramebufferAttachmentCMAAINTELResourceManager(); |
| 27 ~ApplyFramebufferAttachmentCMAAINTELResourceManager(); | 28 ~ApplyFramebufferAttachmentCMAAINTELResourceManager(); |
| 28 | 29 |
| 29 void Initialize(gles2::GLES2Decoder* decoder); | 30 void Initialize(gles2::GLES2Decoder* decoder); |
| 30 void Destroy(); | 31 void Destroy(); |
| 31 | 32 |
| 32 // Applies the algorithm to the color attachments of the currently bound draw | 33 // Applies the algorithm to the color attachments of the currently bound draw |
| 33 // framebuffer. | 34 // framebuffer. |
| 34 void ApplyFramebufferAttachmentCMAAINTEL( | 35 void ApplyFramebufferAttachmentCMAAINTEL( |
| 35 gles2::GLES2Decoder* decoder, | 36 GLES2Decoder* decoder, |
| 36 gles2::Framebuffer* framebuffer, | 37 Framebuffer* framebuffer, |
| 37 gles2::CopyTextureCHROMIUMResourceManager* copier); | 38 CopyTextureCHROMIUMResourceManager* copier, |
| 39 TextureManager* texture_manager); | |
|
Zhenyao Mo
2016/12/09 18:21:05
I prefer exposing texture_manager() to GLES2Decode
dshwang
2017/01/12 17:19:34
That's good idea, but currently this kind of metho
| |
| 38 | 40 |
| 39 private: | 41 private: |
| 40 // Applies the CMAA algorithm to a texture. | 42 // Applies the CMAA algorithm to a texture. |
| 41 void ApplyCMAAEffectTexture(GLuint source_texture, | 43 void ApplyCMAAEffectTexture(GLuint source_texture, |
| 42 GLuint dest_texture, | 44 GLuint dest_texture, |
| 43 bool do_copy); | 45 bool do_copy); |
| 44 | 46 |
| 45 void OnSize(GLint width, GLint height); | 47 void OnSize(GLint width, GLint height); |
| 46 void ReleaseTextures(); | 48 void ReleaseTextures(); |
| 47 | 49 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 88 static const char cmaa_frag_s1_[]; | 90 static const char cmaa_frag_s1_[]; |
| 89 static const char cmaa_frag_s2_[]; | 91 static const char cmaa_frag_s2_[]; |
| 90 | 92 |
| 91 DISALLOW_COPY_AND_ASSIGN(ApplyFramebufferAttachmentCMAAINTELResourceManager); | 93 DISALLOW_COPY_AND_ASSIGN(ApplyFramebufferAttachmentCMAAINTELResourceManager); |
| 92 }; | 94 }; |
| 93 | 95 |
| 94 } // namespace gles2 | 96 } // namespace gles2 |
| 95 } // namespace gpu | 97 } // namespace gpu |
| 96 | 98 |
| 97 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_APPLY_FRAMEBUFFER_ATTACHMENT_CMA A_INTEL_H_ | 99 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_APPLY_FRAMEBUFFER_ATTACHMENT_CMA A_INTEL_H_ |
| OLD | NEW |