Chromium Code Reviews

Unified Diff: src/gpu/gl/GrGLGpu.cpp

Issue 2120403002: Revert of Fix caching of sample locations (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « src/gpu/gl/GrGLGpu.h ('k') | src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLGpu.cpp
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index 99726904873a4f5df4b5feecaa909fc68d2a5fb9..2fb66804e007b78e3f1ecc2888c1fe4cc46a3053 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -4432,8 +4432,10 @@
return true;
}
-void GrGLGpu::onGetMultisampleSpecs(GrRenderTarget* rt, const GrStencilSettings& stencil,
- int* effectiveSampleCnt, SamplePattern* samplePattern) {
+void GrGLGpu::onGetMultisampleSpecs(GrRenderTarget* rt,
+ const GrStencilSettings& stencil,
+ int* effectiveSampleCnt,
+ SkAutoTDeleteArray<SkPoint>* sampleLocations) {
SkASSERT(!rt->hasMixedSamples() || rt->renderTargetPriv().getStencilAttachment() ||
stencil.isDisabled());
@@ -4450,14 +4452,14 @@
SkASSERT(*effectiveSampleCnt >= rt->desc().fSampleCnt);
if (this->caps()->sampleLocationsSupport()) {
- samplePattern->reset(*effectiveSampleCnt);
+ sampleLocations->reset(new SkPoint[*effectiveSampleCnt]);
for (int i = 0; i < *effectiveSampleCnt; ++i) {
GrGLfloat pos[2];
GL_CALL(GetMultisamplefv(GR_GL_SAMPLE_POSITION, i, pos));
if (kTopLeft_GrSurfaceOrigin == rt->origin()) {
- (*samplePattern)[i].set(pos[0], pos[1]);
+ (*sampleLocations)[i].set(pos[0], pos[1]);
} else {
- (*samplePattern)[i].set(pos[0], 1 - pos[1]);
+ (*sampleLocations)[i].set(pos[0], 1 - pos[1]);
}
}
}
« no previous file with comments | « src/gpu/gl/GrGLGpu.h ('k') | src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine