Index: src/gpu/gl/GrGLGpu.cpp |
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp |
index 73d219d03323dcc863786736df427dd4ad7e0348..7a3ec4cead6c3cfa0c4534bf19ebc9e7ae5898de 100644 |
--- a/src/gpu/gl/GrGLGpu.cpp |
+++ b/src/gpu/gl/GrGLGpu.cpp |
@@ -3783,6 +3783,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()); |
+ |
+ 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 pixel space and Skia device space have inverted y directions. |
+ (*pattern)[i].set(pos[0], 1 - pos[1]); |
+ } |
+ } |
+} |
+ |
void GrGLGpu::xferBarrier(GrRenderTarget* rt, GrXferBarrierType type) { |
SkASSERT(type); |
switch (type) { |