diff options
author | bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-01-31 13:35:56 +0000 |
---|---|---|
committer | bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-01-31 13:35:56 +0000 |
commit | 75f9f25d8bf2adc0494f9afbbd5965809ee13aca (patch) | |
tree | ac1c54a28cbc3a8e1b6cc6bbf2ae6b148aa1b87d /include/gpu | |
parent | 75942098c500904edd0b52a56d344a63f5814631 (diff) |
Add code path for Gr client to resolve an Gr-created MSAA render target.
Review URL: http://codereview.appspot.com/5580049/
git-svn-id: http://skia.googlecode.com/svn/trunk@3112 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/gpu')
-rw-r--r-- | include/gpu/GrContext.h | 14 | ||||
-rw-r--r-- | include/gpu/GrRenderTarget.h | 8 |
2 files changed, 22 insertions, 0 deletions
diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h index ca440a6243..3fb47750cf 100644 --- a/include/gpu/GrContext.h +++ b/include/gpu/GrContext.h @@ -562,6 +562,20 @@ public: * @param dst the render target to copy to. */ void copyTexture(GrTexture* src, GrRenderTarget* dst); + + /** + * Resolves a render target that has MSAA. The intermediate MSAA buffer is + * downsampled to the associated GrTexture (accessible via + * GrRenderTarget::asTexture()). Any pending draws to the render target will + * be executed before the resolve. + * + * This is only necessary when a client wants to access the object directly + * using the underlying graphics API. GrContext will detect when it must + * perform a resolve to a GrTexture used as the source of a draw or before + * reading pixels back from a GrTexture or GrRenderTarget. + */ + void resolveRenderTarget(GrRenderTarget* target); + /** * Applies a 1D convolution kernel in the X direction to a rectangle of * pixels from a given texture. diff --git a/include/gpu/GrRenderTarget.h b/include/gpu/GrRenderTarget.h index 13b2160f79..909adb3e7d 100644 --- a/include/gpu/GrRenderTarget.h +++ b/include/gpu/GrRenderTarget.h @@ -112,6 +112,14 @@ public: */ const GrIRect& getResolveRect() const { return fResolveRect; } + /** + * If the render target is multisampled this will perform a multisample + * resolve. Any pending draws to the target are first flushed. This only + * applies to render targets that are associated with GrTextures. After the + * function returns the GrTexture will contain the resolved pixels. + */ + void resolve(); + // GrResource overrides virtual size_t sizeInBytes() const; |