skia2/include
ericrk f7b8b8affe Add wrapBackendTextureAsRenderTarget API
Skia's GrTextureProvider currently exposes two APIs for wrapping backend
objects:
 * wrapBackendTexture - wraps a texture into a GrTexture. Depending on
   flags, this GrTexture can be converted to a GrRenderTarget. Skia
   manages the render target objects it may create to provide a render
   target for the texture. This allows Skia to create stencil buffers
   if needed and manager MSAA resolves.
 * wrapBackendRenderTarget - wraps a FBO into a GrRenderTarget. This
   object cannot be converted to a GrTexture. Skia does not manage
   the render target objects for such a GrRenderTarget, and as such
   cannot attach stencil buffers or perform MSAA resolves on the
   created GrRenderTarget.

Given these two options, wrapBackendTexture provides more versatility
and allows Skia more room for optimization. Chrome currently uses
wrapBackendTexture for this reason.

While these two functions cover most cases, they do not provide a way
for Skia to wrap a texture into a render target (and gain the MSAA and
stencil buffer management), without also creating a GrTexture. This is
problematic in cases where a texture can be bound to a render target,
but cannot be textured from, as is the case in Chrome's limited support
for GL_TEXTURE_RECTANGLE.

To address this, a new function is created:
 * wrapBackendTextureAsRenderTarget - wraps a texture into a
   GrRenderTarget. As with wrapBackendTexture, the created render
   target objects are fully managed by Skia. Unlike wrapBackendTexture
   no GrTexture is created, and the created object will never be
   textured from.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1709163003

Review URL: https://codereview.chromium.org/1709163003
2016-02-24 14:49:52 -08:00
..
android Move SkBitmapRegionDecoder to include/android and src/android 2015-11-13 06:11:09 -08:00
animator
c add drawCircle to c api 2016-02-09 13:25:51 -08:00
client/android Alter SkXfermode's asFragmentProcessor & asXPFactory contracts 2016-02-09 05:09:28 -08:00
codec Implement onSkipScanlines() for bmp and wbmp 2016-02-11 13:29:36 -08:00
config Add Histogram Macros to Skia 2016-02-05 15:32:36 -08:00
core Add wrapBackendTextureAsRenderTarget API 2016-02-24 14:49:52 -08:00
device/xps CMake, include/: changes to make fiddle 2.0 better 2015-12-01 09:02:49 -08:00
effects fix misc asserts and checks found by fuzzer 2016-02-22 12:50:26 -08:00
gpu Add wrapBackendTextureAsRenderTarget API 2016-02-24 14:49:52 -08:00
images Delete SkDecodingImageGenerator 2016-02-11 14:17:17 -08:00
pathops Move SkTDArray to private. 2016-02-18 08:53:33 -08:00
ports Move SkTArray to include/private. 2016-02-17 13:13:44 -08:00
private GrAuditTrail can now be enabled/disabled at runtime 2016-02-18 13:45:40 -08:00
svg move SkTDict and SkTSearch into private 2016-01-03 18:36:05 -08:00
utils Move SkTDArray to private. 2016-02-18 08:53:33 -08:00
views Move SkTDArray to private. 2016-02-18 08:53:33 -08:00
xml Move SkTDArray to private. 2016-02-18 08:53:33 -08:00