Index: src/gpu/gl/GrGLGpu.cpp |
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp |
index 29841331c01d308d45b7c1948db0dfe54547a4a6..3688f8bf76f52ec575256220ab4fab7fb8ce9fee 100644 |
--- a/src/gpu/gl/GrGLGpu.cpp |
+++ b/src/gpu/gl/GrGLGpu.cpp |
@@ -4138,6 +4138,33 @@ bool GrGLGpu::copySurfaceAsBlitFramebuffer(GrSurface* dst, |
return true; |
} |
+void GrGLGpu::onGetMultisampleSpecs(GrRenderTarget* rt, |
+ const GrStencilSettings& stencil, |
+ int* effectiveSampleCnt, |
+ SamplePattern* pattern) { |
+ SkASSERT(!rt->hasMixedSamples() || rt->renderTargetPriv().getStencilAttachment() || |
+ stencil.isDisabled()); |
+ |
+ this->flushStencil(stencil); |
+ this->flushHWAAState(rt, true, !stencil.isDisabled()); |
+ this->flushRenderTarget(static_cast<GrGLRenderTarget*>(rt), &SkIRect::EmptyIRect()); |
bsalomon
2016/03/01 14:28:55
Is this why we wind up caching this on the RT? Is
Chris Dalton
2016/03/01 20:37:47
EXT_raster_multisample says:
"The sample locat
|
+ |
+ if (0 != this->caps()->maxRasterSamples()) { |
+ GR_GL_GetIntegerv(this->glInterface(), GR_GL_EFFECTIVE_RASTER_SAMPLES, effectiveSampleCnt); |
+ } else { |
+ GR_GL_GetIntegerv(this->glInterface(), GR_GL_SAMPLES, effectiveSampleCnt); |
+ } |
+ if (this->caps()->sampleLocationsSupport()) { |
+ pattern->reset(*effectiveSampleCnt); |
+ for (int i = 0; i < *effectiveSampleCnt; ++i) { |
+ GrGLfloat pos[2]; |
+ GL_CALL(GetMultisamplefv(GR_GL_SAMPLE_POSITION, i, pos)); |
+ // OpenGL window space and Skia device space have inverted y directions. |
+ (*pattern)[i].set(pos[0], 1 - pos[1]); |
bsalomon
2016/03/01 14:28:55
Skia conceptually places the origin at the top of
Chris Dalton
2016/03/01 20:37:47
Ah, good point. Device space is a Skia concept, so
Chris Dalton
2016/03/07 16:09:38
Done.
|
+ } |
+ } |
+} |
+ |
void GrGLGpu::xferBarrier(GrRenderTarget* rt, GrXferBarrierType type) { |
SkASSERT(type); |
switch (type) { |