diff options
author | vbuzinov <vbuzinov@nvidia.com> | 2015-06-12 08:59:45 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-06-12 08:59:45 -0700 |
commit | dded69693dd3779f081326cde24c3954505b129d (patch) | |
tree | 0cfc3a16d31093185082268ab16599edb7c0464f /src/gpu/SkGpuDevice.cpp | |
parent | 57856a1f589bea64ed84535efed0668221060f9b (diff) |
Implement support for mixed sampled render targets
Adds a new FBO type kStencil_MSFBOType that is selected whenever
NV_framebuffer_mixed_samples extension is available. In this new
FBO type a non-msaa color buffer is created with a multisampled
stencil buffer attachment.
Replaces numSamples() with separate numColorSamples and numStencilSamples
methods in RenderTarget.
In mixed samples mode non-MSAA codepaths are used to draw simple shapes,
while NVPR-rendered paths and text are rendered with a multisampled
stencil.
BUG=skia:3177
Review URL: https://codereview.chromium.org/1001503002
Diffstat (limited to 'src/gpu/SkGpuDevice.cpp')
-rw-r--r-- | src/gpu/SkGpuDevice.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp index 6db5c1db0d..18b2643564 100644 --- a/src/gpu/SkGpuDevice.cpp +++ b/src/gpu/SkGpuDevice.cpp @@ -333,7 +333,7 @@ void SkGpuDevice::replaceRenderTarget(bool shouldRetainContent) { : SkSurface::kNo_Budgeted; SkAutoTUnref<GrRenderTarget> newRT(CreateRenderTarget( - fRenderTarget->getContext(), budgeted, this->imageInfo(), fRenderTarget->numSamples())); + fRenderTarget->getContext(), budgeted, this->imageInfo(), fRenderTarget->desc().fSampleCnt)); if (NULL == newRT) { return; @@ -919,7 +919,7 @@ void SkGpuDevice::drawBitmapCommon(const SkDraw& draw, // anti-aliased edges, we work around that for now by drawing directly // if the image size exceeds maximum texture size. int maxTextureSize = fContext->caps()->maxTextureSize(); - bool directDraw = fRenderTarget->isMultisampled() || + bool directDraw = fRenderTarget->isUnifiedMultisampled() || !paint.isAntiAlias() || bitmap.width() > maxTextureSize || bitmap.height() > maxTextureSize; @@ -1690,7 +1690,7 @@ SkBaseDevice* SkGpuDevice::onCreateDevice(const CreateInfo& cinfo, const SkPaint desc.fFlags = kRenderTarget_GrSurfaceFlag; desc.fWidth = cinfo.fInfo.width(); desc.fHeight = cinfo.fInfo.height(); - desc.fSampleCnt = fRenderTarget->numSamples(); + desc.fSampleCnt = fRenderTarget->desc().fSampleCnt; SkAutoTUnref<GrTexture> texture; // Skia's convention is to only clear a device if it is non-opaque. @@ -1718,7 +1718,7 @@ SkBaseDevice* SkGpuDevice::onCreateDevice(const CreateInfo& cinfo, const SkPaint SkSurface* SkGpuDevice::newSurface(const SkImageInfo& info, const SkSurfaceProps& props) { // TODO: Change the signature of newSurface to take a budgeted parameter. static const SkSurface::Budgeted kBudgeted = SkSurface::kNo_Budgeted; - return SkSurface::NewRenderTarget(fContext, kBudgeted, info, fRenderTarget->numSamples(), + return SkSurface::NewRenderTarget(fContext, kBudgeted, info, fRenderTarget->desc().fSampleCnt, &props); } @@ -1758,7 +1758,7 @@ bool SkGpuDevice::EXPERIMENTAL_drawPicture(SkCanvas* mainCanvas, const SkPicture initialMatrix, clipBounds, &atlasedNeedRendering, &atlasedRecycled, - fRenderTarget->numSamples()); + fRenderTarget->numColorSamples()); GrLayerHoister::DrawLayersToAtlas(fContext, atlasedNeedRendering); @@ -1770,7 +1770,7 @@ bool SkGpuDevice::EXPERIMENTAL_drawPicture(SkCanvas* mainCanvas, const SkPicture initialMatrix, clipBounds, &needRendering, &recycled, - fRenderTarget->numSamples()); + fRenderTarget->numColorSamples()); GrLayerHoister::DrawLayers(fContext, needRendering); |