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

Unified Diff: Source/platform/graphics/gpu/DrawingBuffer.cpp

Issue 1301923002: Add GL_CHROMIUM_screen_space_antialiasing to support alternative AA (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: Source/platform/graphics/gpu/DrawingBuffer.cpp
diff --git a/Source/platform/graphics/gpu/DrawingBuffer.cpp b/Source/platform/graphics/gpu/DrawingBuffer.cpp
index f4d21767f72f093370f435a7a7faef2ea12eb3f1..f8ad4ec371d5488091633183e50593efffe73bd8 100644
--- a/Source/platform/graphics/gpu/DrawingBuffer.cpp
+++ b/Source/platform/graphics/gpu/DrawingBuffer.cpp
@@ -434,8 +434,12 @@ bool DrawingBuffer::initialize(const IntSize& size)
if (m_requestedAttributes.antialias && m_multisampleExtensionSupported) {
m_context->getIntegerv(GL_MAX_SAMPLES_ANGLE, &maxSampleCount);
m_multisampleMode = ExplicitResolve;
- if (m_extensionsUtil->supportsExtension("GL_EXT_multisampled_render_to_texture"))
+ if (m_extensionsUtil->supportsExtension("GL_EXT_multisampled_render_to_texture")) {
m_multisampleMode = ImplicitResolve;
+ }
+ if (m_extensionsUtil->supportsExtension("GL_INTEL_framebuffer_CMAA")) {
bajones 2015/08/19 16:26:44 Nit: This should be an `else if`
Ken Russell (switch to Gerrit) 2015/08/19 17:56:18 Or does the Intel hardware supporting INTEL_frameb
+ m_multisampleMode = INTELCMAAResolve;
piman 2015/08/19 16:36:51 drive-by nit: CMAA is not multisampling, maybe ren
Ken Russell (switch to Gerrit) 2015/08/19 17:56:18 I like Antoine's suggestion. Could you please make
+ }
}
m_sampleCount = std::min(4, maxSampleCount);
@@ -815,6 +819,11 @@ void DrawingBuffer::commit()
}
m_context->bindFramebuffer(GL_FRAMEBUFFER, m_fbo);
+ if (m_multisampleMode == INTELCMAAResolve) {
+ // Apply CMAA(Conservative Morphological Anti-Aliasing) algorithm to the color buffer of m_fbo.
+ // Reference: https://software.intel.com/en-us/articles/conservative-morphological-anti-aliasing-cmaa
+ m_context->applyFramebufferAttachmentCMAAINTEL();
+ }
m_contentsChangeCommitted = true;
}

Powered by Google App Engine
This is Rietveld 408576698