GrRenderTargetContext.h revision 693a540272a771c6b0830094c461397cb77543b1
1ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips/* 2ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips * Copyright 2015 Google Inc. 3ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips * 4ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips * Use of this source code is governed by a BSD-style license that can be 5ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips * found in the LICENSE file. 6ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips */ 7ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips 81105224f9701e57ec5ce0354d6a380b664f5c638Brian Osman#ifndef GrRenderTargetContext_DEFINED 91105224f9701e57ec5ce0354d6a380b664f5c638Brian Osman#define GrRenderTargetContext_DEFINED 10ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips 11ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips#include "GrColor.h" 12faf8203ea7588dcdca82f69f5a5447b3eb53a849bsalomon#include "GrContext.h" 13ecbc12b1c1c72de0cf7bba4a3f6a7cce4f43bf41csmartdalton#include "GrPaint.h" 147bceedc550513b13e0065aca66e55204a2ba3e1frobertphillips#include "GrRenderTarget.h" 15ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips#include "SkRefCnt.h" 16391395dcfbff09a83f8f0e9d3e02d38c855ae2e9robertphillips#include "SkRegion.h" 17fcf7829b67b798aff4c41c4688daa9c7381991e6robertphillips#include "SkSurfaceProps.h" 18a7f29640f6ab4eb50962a9d9f12d01ac2ce8b471csmartdalton#include "../private/GrInstancedPipelineInfo.h" 191de610a5287cf61d4f3a1fdc7413bd74827a8b6ajoshualitt#include "../private/GrSingleOwner.h" 20ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips 21bc90735170b5d85a19b24df0baa865f7cf87d348joshualittclass GrAuditTrail; 22ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillipsclass GrClip; 23abd30f54b7ff1704a8930c4307ea242d09425d02bsalomonclass GrDrawBatch; 241105224f9701e57ec5ce0354d6a380b664f5c638Brian Osmanclass GrRenderTargetContextPriv; 258ff8d24c83353fc421177886d82202da9ff89234cdaltonclass GrDrawPathBatchBase; 2677a2e52c7d5c77de73ecab5fec79072ee4460706robertphillipsclass GrDrawingManager; 2729df76096fd30941086324902a82656df2d8becdcsmartdaltonclass GrFixedClip; 28ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillipsclass GrPaint; 29ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillipsclass GrPathProcessor; 30ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillipsclass GrPipelineBuilder; 31ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillipsclass GrRenderTarget; 32f2361d2d93c200cd4555b5e8ecea4531801abaaaRobert Phillipsclass GrRenderTargetOpList; 336663acff010ce752e4bf778da81fa97448c9db31bsalomonclass GrStyle; 34ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillipsclass GrSurface; 35443023975e335e3630191227dbc21fa72c436af3robertphillipsstruct GrUserStencilSettings; 362334fb655f8d4ef5915770d32bf845c88d3627f4robertphillipsclass SkDrawFilter; 37ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillipsstruct SkIPoint; 38ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillipsstruct SkIRect; 3910e3d9bf59bdec92c05367ae0b71e1ce1ee4a690msarettclass SkLatticeIter; 40ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillipsclass SkMatrix; 412334fb655f8d4ef5915770d32bf845c88d3627f4robertphillipsclass SkPaint; 42ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillipsclass SkPath; 43ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillipsstruct SkPoint; 44ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillipsstruct SkRect; 45ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillipsclass SkRRect; 4631ff762dc8bfcd86eb4af92b18fdad36913a04e5jvanverthstruct SkRSXform; 472334fb655f8d4ef5915770d32bf845c88d3627f4robertphillipsclass SkTextBlob; 48ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips 49ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips/* 50ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips * A helper object to orchestrate draws 51ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips */ 521105224f9701e57ec5ce0354d6a380b664f5c638Brian Osmanclass SK_API GrRenderTargetContext : public SkRefCnt { 53ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillipspublic: 541105224f9701e57ec5ce0354d6a380b664f5c638Brian Osman ~GrRenderTargetContext() override; 552334fb655f8d4ef5915770d32bf845c88d3627f4robertphillips 56b8fea97a7a493897fcff33aa2932d875c572f163bsalomon bool copySurface(GrSurface* src, const SkIRect& srcRect, const SkIPoint& dstPoint); 57ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips 582334fb655f8d4ef5915770d32bf845c88d3627f4robertphillips // TODO: it is odd that we need both the SkPaint in the following 3 methods. 592334fb655f8d4ef5915770d32bf845c88d3627f4robertphillips // We should extract the text parameters from SkPaint and pass them separately 606663acff010ce752e4bf778da81fa97448c9db31bsalomon // akin to GrStyle (GrTextInfo?) 6196880d9e366d58e5960aa0ee6aa67260797679ebjoshualitt virtual void drawText(const GrClip&, const GrPaint&, const SkPaint&, 6296880d9e366d58e5960aa0ee6aa67260797679ebjoshualitt const SkMatrix& viewMatrix, const char text[], size_t byteLength, 6396880d9e366d58e5960aa0ee6aa67260797679ebjoshualitt SkScalar x, SkScalar y, const SkIRect& clipBounds); 6496880d9e366d58e5960aa0ee6aa67260797679ebjoshualitt virtual void drawPosText(const GrClip&, const GrPaint&, const SkPaint&, 6596880d9e366d58e5960aa0ee6aa67260797679ebjoshualitt const SkMatrix& viewMatrix, const char text[], size_t byteLength, 6696880d9e366d58e5960aa0ee6aa67260797679ebjoshualitt const SkScalar pos[], int scalarsPerPosition, 6796880d9e366d58e5960aa0ee6aa67260797679ebjoshualitt const SkPoint& offset, const SkIRect& clipBounds); 6896880d9e366d58e5960aa0ee6aa67260797679ebjoshualitt virtual void drawTextBlob(const GrClip&, const SkPaint&, 6996880d9e366d58e5960aa0ee6aa67260797679ebjoshualitt const SkMatrix& viewMatrix, const SkTextBlob*, 7096880d9e366d58e5960aa0ee6aa67260797679ebjoshualitt SkScalar x, SkScalar y, 7196880d9e366d58e5960aa0ee6aa67260797679ebjoshualitt SkDrawFilter*, const SkIRect& clipBounds); 72ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips 73ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips /** 74ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips * Provides a perfomance hint that the render target's contents are allowed 75ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips * to become undefined. 76ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips */ 772e1e51f04985f7c258b96f0decc190456f5dd74drobertphillips void discard(); 78ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips 79ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips /** 80ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips * Clear the entire or rect of the render target, ignoring any clips. 81ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips * @param rect the rect to clear or the whole thing if rect is NULL. 82ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips * @param color the color to clear to. 83ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips * @param canIgnoreRect allows partial clears to be converted to whole 84ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips * clears on platforms for which that is cheap 85ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips */ 862e1e51f04985f7c258b96f0decc190456f5dd74drobertphillips void clear(const SkIRect* rect, GrColor color, bool canIgnoreRect); 87ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips 88ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips /** 89ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips * Draw everywhere (respecting the clip) with the paint. 90ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips */ 912e1e51f04985f7c258b96f0decc190456f5dd74drobertphillips void drawPaint(const GrClip&, const GrPaint&, const SkMatrix& viewMatrix); 92ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips 93ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips /** 94ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips * Draw the rect using a paint. 95ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips * @param paint describes how to color pixels. 96ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips * @param viewMatrix transformation matrix 976663acff010ce752e4bf778da81fa97448c9db31bsalomon * @param style The style to apply. Null means fill. Currently path effects are not 986663acff010ce752e4bf778da81fa97448c9db31bsalomon * allowed. 99ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips * The rects coords are used to access the paint (through texture matrix) 100ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips */ 1012e1e51f04985f7c258b96f0decc190456f5dd74drobertphillips void drawRect(const GrClip&, 102ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips const GrPaint& paint, 103ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips const SkMatrix& viewMatrix, 104ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips const SkRect&, 1056663acff010ce752e4bf778da81fa97448c9db31bsalomon const GrStyle* style = nullptr); 106ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips 107ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips /** 108a2e69fcdedbd9a7762620e0e9dcdd86596369cffbsalomon * Maps a rectangle of shader coordinates to a rectangle and fills that rectangle. 109ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips * 110ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips * @param paint describes how to color pixels. 111ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips * @param viewMatrix transformation matrix which applies to rectToDraw 112ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips * @param rectToDraw the rectangle to draw 113ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips * @param localRect the rectangle of shader coordinates applied to rectToDraw 114ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips */ 115a2e69fcdedbd9a7762620e0e9dcdd86596369cffbsalomon void fillRectToRect(const GrClip&, 116a2e69fcdedbd9a7762620e0e9dcdd86596369cffbsalomon const GrPaint& paint, 117a2e69fcdedbd9a7762620e0e9dcdd86596369cffbsalomon const SkMatrix& viewMatrix, 118a2e69fcdedbd9a7762620e0e9dcdd86596369cffbsalomon const SkRect& rectToDraw, 119a2e69fcdedbd9a7762620e0e9dcdd86596369cffbsalomon const SkRect& localRect); 120ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips 121ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips /** 122a2e69fcdedbd9a7762620e0e9dcdd86596369cffbsalomon * Fills a rect with a paint and a localMatrix. 123ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips */ 124a2e69fcdedbd9a7762620e0e9dcdd86596369cffbsalomon void fillRectWithLocalMatrix(const GrClip& clip, 125a2e69fcdedbd9a7762620e0e9dcdd86596369cffbsalomon const GrPaint& paint, 126a2e69fcdedbd9a7762620e0e9dcdd86596369cffbsalomon const SkMatrix& viewMatrix, 127a2e69fcdedbd9a7762620e0e9dcdd86596369cffbsalomon const SkRect& rect, 128a2e69fcdedbd9a7762620e0e9dcdd86596369cffbsalomon const SkMatrix& localMatrix); 129ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips 130ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips /** 131ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips * Draw a roundrect using a paint. 132ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips * 133ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips * @param paint describes how to color pixels. 134ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips * @param viewMatrix transformation matrix 135ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips * @param rrect the roundrect to draw 1366663acff010ce752e4bf778da81fa97448c9db31bsalomon * @param style style to apply to the rrect. Currently path effects are not allowed. 137ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips */ 1382e1e51f04985f7c258b96f0decc190456f5dd74drobertphillips void drawRRect(const GrClip&, 139ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips const GrPaint&, 140ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips const SkMatrix& viewMatrix, 141ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips const SkRRect& rrect, 1426663acff010ce752e4bf778da81fa97448c9db31bsalomon const GrStyle& style); 143ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips 144ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips /** 145000958973f4b514cddbfdcc01ec167437b66de2crobertphillips * Shortcut for drawing an SkPath consisting of nested rrects using a paint. 146000958973f4b514cddbfdcc01ec167437b66de2crobertphillips * Does not support stroking. The result is undefined if outer does not contain 147000958973f4b514cddbfdcc01ec167437b66de2crobertphillips * inner. 148000958973f4b514cddbfdcc01ec167437b66de2crobertphillips * 149000958973f4b514cddbfdcc01ec167437b66de2crobertphillips * @param paint describes how to color pixels. 150000958973f4b514cddbfdcc01ec167437b66de2crobertphillips * @param viewMatrix transformation matrix 151000958973f4b514cddbfdcc01ec167437b66de2crobertphillips * @param outer the outer roundrect 152000958973f4b514cddbfdcc01ec167437b66de2crobertphillips * @param inner the inner roundrect 153000958973f4b514cddbfdcc01ec167437b66de2crobertphillips */ 154000958973f4b514cddbfdcc01ec167437b66de2crobertphillips void drawDRRect(const GrClip&, 155000958973f4b514cddbfdcc01ec167437b66de2crobertphillips const GrPaint&, 156000958973f4b514cddbfdcc01ec167437b66de2crobertphillips const SkMatrix& viewMatrix, 157000958973f4b514cddbfdcc01ec167437b66de2crobertphillips const SkRRect& outer, 158000958973f4b514cddbfdcc01ec167437b66de2crobertphillips const SkRRect& inner); 159000958973f4b514cddbfdcc01ec167437b66de2crobertphillips 160000958973f4b514cddbfdcc01ec167437b66de2crobertphillips /** 161ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips * Draws a path. 162ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips * 163ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips * @param paint describes how to color pixels. 164ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips * @param viewMatrix transformation matrix 165ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips * @param path the path to draw 1666663acff010ce752e4bf778da81fa97448c9db31bsalomon * @param style style to apply to the path. 167ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips */ 1682e1e51f04985f7c258b96f0decc190456f5dd74drobertphillips void drawPath(const GrClip&, 169ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips const GrPaint&, 170ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips const SkMatrix& viewMatrix, 171ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips const SkPath&, 1726663acff010ce752e4bf778da81fa97448c9db31bsalomon const GrStyle& style); 173ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips 174ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips /** 175ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips * Draws vertices with a paint. 176ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips * 177ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips * @param paint describes how to color pixels. 178ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips * @param viewMatrix transformation matrix 179ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips * @param primitiveType primitives type to draw. 180ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips * @param vertexCount number of vertices. 181ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips * @param positions array of vertex positions, required. 182ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips * @param texCoords optional array of texture coordinates used 183ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips * to access the paint. 184ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips * @param colors optional array of per-vertex colors, supercedes 185ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips * the paint's color field. 186ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips * @param indices optional array of indices. If NULL vertices 187ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips * are drawn non-indexed. 188ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips * @param indexCount if indices is non-null then this is the 189ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips * number of indices. 190ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips */ 1912e1e51f04985f7c258b96f0decc190456f5dd74drobertphillips void drawVertices(const GrClip&, 192ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips const GrPaint& paint, 193ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips const SkMatrix& viewMatrix, 194ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips GrPrimitiveType primitiveType, 195ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips int vertexCount, 196ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips const SkPoint positions[], 197ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips const SkPoint texs[], 198ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips const GrColor colors[], 199ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips const uint16_t indices[], 200ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips int indexCount); 201ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips 202ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips /** 20331ff762dc8bfcd86eb4af92b18fdad36913a04e5jvanverth * Draws textured sprites from an atlas with a paint. 20431ff762dc8bfcd86eb4af92b18fdad36913a04e5jvanverth * 20531ff762dc8bfcd86eb4af92b18fdad36913a04e5jvanverth * @param paint describes how to color pixels. 20631ff762dc8bfcd86eb4af92b18fdad36913a04e5jvanverth * @param viewMatrix transformation matrix 20731ff762dc8bfcd86eb4af92b18fdad36913a04e5jvanverth * @param spriteCount number of sprites. 20831ff762dc8bfcd86eb4af92b18fdad36913a04e5jvanverth * @param xform array of compressed transformation data, required. 20931ff762dc8bfcd86eb4af92b18fdad36913a04e5jvanverth * @param texRect array of texture rectangles used to access the paint. 21031ff762dc8bfcd86eb4af92b18fdad36913a04e5jvanverth * @param colors optional array of per-sprite colors, supercedes 21131ff762dc8bfcd86eb4af92b18fdad36913a04e5jvanverth * the paint's color field. 21231ff762dc8bfcd86eb4af92b18fdad36913a04e5jvanverth */ 2132e1e51f04985f7c258b96f0decc190456f5dd74drobertphillips void drawAtlas(const GrClip&, 21431ff762dc8bfcd86eb4af92b18fdad36913a04e5jvanverth const GrPaint& paint, 21531ff762dc8bfcd86eb4af92b18fdad36913a04e5jvanverth const SkMatrix& viewMatrix, 21631ff762dc8bfcd86eb4af92b18fdad36913a04e5jvanverth int spriteCount, 21731ff762dc8bfcd86eb4af92b18fdad36913a04e5jvanverth const SkRSXform xform[], 21831ff762dc8bfcd86eb4af92b18fdad36913a04e5jvanverth const SkRect texRect[], 21931ff762dc8bfcd86eb4af92b18fdad36913a04e5jvanverth const SkColor colors[]); 220cc319b95a58ae15e88c3c028b8726e7cab9121ffmsarett 221cc319b95a58ae15e88c3c028b8726e7cab9121ffmsarett /** 222cc319b95a58ae15e88c3c028b8726e7cab9121ffmsarett * Draws a region. 223cc319b95a58ae15e88c3c028b8726e7cab9121ffmsarett * 224cc319b95a58ae15e88c3c028b8726e7cab9121ffmsarett * @param paint describes how to color pixels 225cc319b95a58ae15e88c3c028b8726e7cab9121ffmsarett * @param viewMatrix transformation matrix 226cc319b95a58ae15e88c3c028b8726e7cab9121ffmsarett * @param region the region to be drawn 227cc319b95a58ae15e88c3c028b8726e7cab9121ffmsarett * @param style style to apply to the region 228cc319b95a58ae15e88c3c028b8726e7cab9121ffmsarett */ 229cc319b95a58ae15e88c3c028b8726e7cab9121ffmsarett void drawRegion(const GrClip&, 230cc319b95a58ae15e88c3c028b8726e7cab9121ffmsarett const GrPaint& paint, 231cc319b95a58ae15e88c3c028b8726e7cab9121ffmsarett const SkMatrix& viewMatrix, 232cc319b95a58ae15e88c3c028b8726e7cab9121ffmsarett const SkRegion& region, 233cc319b95a58ae15e88c3c028b8726e7cab9121ffmsarett const GrStyle& style); 234cc319b95a58ae15e88c3c028b8726e7cab9121ffmsarett 23531ff762dc8bfcd86eb4af92b18fdad36913a04e5jvanverth /** 236ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips * Draws an oval. 237ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips * 238ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips * @param paint describes how to color pixels. 239ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips * @param viewMatrix transformation matrix 240ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips * @param oval the bounding rect of the oval. 2416663acff010ce752e4bf778da81fa97448c9db31bsalomon * @param style style to apply to the oval. Currently path effects are not allowed. 242ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips */ 2432e1e51f04985f7c258b96f0decc190456f5dd74drobertphillips void drawOval(const GrClip&, 244ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips const GrPaint& paint, 245ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips const SkMatrix& viewMatrix, 246ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips const SkRect& oval, 2476663acff010ce752e4bf778da81fa97448c9db31bsalomon const GrStyle& style); 2484f3a0ca85d28a8fc7fcc1ac5c4a1864c66bdea14bsalomon /** 2494f3a0ca85d28a8fc7fcc1ac5c4a1864c66bdea14bsalomon * Draws a partial arc of an oval. 2504f3a0ca85d28a8fc7fcc1ac5c4a1864c66bdea14bsalomon * 2514f3a0ca85d28a8fc7fcc1ac5c4a1864c66bdea14bsalomon * @param paint describes how to color pixels. 2524f3a0ca85d28a8fc7fcc1ac5c4a1864c66bdea14bsalomon * @param viewMatrix transformation matrix. 2534f3a0ca85d28a8fc7fcc1ac5c4a1864c66bdea14bsalomon * @param oval the bounding rect of the oval. 2544f3a0ca85d28a8fc7fcc1ac5c4a1864c66bdea14bsalomon * @param startAngle starting angle in degrees. 2554f3a0ca85d28a8fc7fcc1ac5c4a1864c66bdea14bsalomon * @param sweepAngle angle to sweep in degrees. Must be in (-360, 360) 2564f3a0ca85d28a8fc7fcc1ac5c4a1864c66bdea14bsalomon * @param useCenter true means that the implied path begins at the oval center, connects as a 2574f3a0ca85d28a8fc7fcc1ac5c4a1864c66bdea14bsalomon * line to the point indicated by the start contains the arc indicated by 2584f3a0ca85d28a8fc7fcc1ac5c4a1864c66bdea14bsalomon * the sweep angle. If false the line beginning at the center point is 2594f3a0ca85d28a8fc7fcc1ac5c4a1864c66bdea14bsalomon * omitted. 2604f3a0ca85d28a8fc7fcc1ac5c4a1864c66bdea14bsalomon * @param style style to apply to the oval. 2614f3a0ca85d28a8fc7fcc1ac5c4a1864c66bdea14bsalomon */ 2624f3a0ca85d28a8fc7fcc1ac5c4a1864c66bdea14bsalomon void drawArc(const GrClip&, 2634f3a0ca85d28a8fc7fcc1ac5c4a1864c66bdea14bsalomon const GrPaint& paint, 2644f3a0ca85d28a8fc7fcc1ac5c4a1864c66bdea14bsalomon const SkMatrix& viewMatrix, 2654f3a0ca85d28a8fc7fcc1ac5c4a1864c66bdea14bsalomon const SkRect& oval, 2664f3a0ca85d28a8fc7fcc1ac5c4a1864c66bdea14bsalomon SkScalar startAngle, 2674f3a0ca85d28a8fc7fcc1ac5c4a1864c66bdea14bsalomon SkScalar sweepAngle, 2684f3a0ca85d28a8fc7fcc1ac5c4a1864c66bdea14bsalomon bool useCenter, 2694f3a0ca85d28a8fc7fcc1ac5c4a1864c66bdea14bsalomon const GrStyle& style); 270ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips 27133a5fce6126dc5d3927a71fdc6c35af6f5893fd5joshualitt /** 2724f3a0ca85d28a8fc7fcc1ac5c4a1864c66bdea14bsalomon * Draw the image as a set of rects, specified by |iter|. 27333a5fce6126dc5d3927a71fdc6c35af6f5893fd5joshualitt */ 27410e3d9bf59bdec92c05367ae0b71e1ce1ee4a690msarett void drawImageLattice(const GrClip&, 27510e3d9bf59bdec92c05367ae0b71e1ce1ee4a690msarett const GrPaint& paint, 27610e3d9bf59bdec92c05367ae0b71e1ce1ee4a690msarett const SkMatrix& viewMatrix, 27710e3d9bf59bdec92c05367ae0b71e1ce1ee4a690msarett int imageWidth, 27810e3d9bf59bdec92c05367ae0b71e1ce1ee4a690msarett int imageHeight, 27910e3d9bf59bdec92c05367ae0b71e1ce1ee4a690msarett std::unique_ptr<SkLatticeIter> iter, 28010e3d9bf59bdec92c05367ae0b71e1ce1ee4a690msarett const SkRect& dst); 281ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips 2828c523e0f3ffa66eefd70f893e9f863b7d9ea3dc9robertphillips /** 2838c523e0f3ffa66eefd70f893e9f863b7d9ea3dc9robertphillips * After this returns any pending surface IO will be issued to the backend 3D API and 2848c523e0f3ffa66eefd70f893e9f863b7d9ea3dc9robertphillips * if the surface has MSAA it will be resolved. 2858c523e0f3ffa66eefd70f893e9f863b7d9ea3dc9robertphillips */ 2868c523e0f3ffa66eefd70f893e9f863b7d9ea3dc9robertphillips void prepareForExternalIO(); 2878c523e0f3ffa66eefd70f893e9f863b7d9ea3dc9robertphillips 2881da3ecd07836a72c9225c896d2516625906b4bdarobertphillips /** 2891105224f9701e57ec5ce0354d6a380b664f5c638Brian Osman * Reads a rectangle of pixels from the render target context. 2901da3ecd07836a72c9225c896d2516625906b4bdarobertphillips * @param dstInfo image info for the destination 2911da3ecd07836a72c9225c896d2516625906b4bdarobertphillips * @param dstBuffer destination pixels for the read 2921da3ecd07836a72c9225c896d2516625906b4bdarobertphillips * @param dstRowBytes bytes in a row of 'dstBuffer' 2931105224f9701e57ec5ce0354d6a380b664f5c638Brian Osman * @param x x offset w/in the render target context from which to read 2941105224f9701e57ec5ce0354d6a380b664f5c638Brian Osman * @param y y offset w/in the render target context from which to read 2951da3ecd07836a72c9225c896d2516625906b4bdarobertphillips * 2961da3ecd07836a72c9225c896d2516625906b4bdarobertphillips * @return true if the read succeeded, false if not. The read can fail because of an 2971da3ecd07836a72c9225c896d2516625906b4bdarobertphillips * unsupported pixel config. 2981da3ecd07836a72c9225c896d2516625906b4bdarobertphillips */ 2991da3ecd07836a72c9225c896d2516625906b4bdarobertphillips bool readPixels(const SkImageInfo& dstInfo, void* dstBuffer, size_t dstRowBytes, int x, int y); 3001da3ecd07836a72c9225c896d2516625906b4bdarobertphillips 3011da3ecd07836a72c9225c896d2516625906b4bdarobertphillips /** 3021da3ecd07836a72c9225c896d2516625906b4bdarobertphillips * Writes a rectangle of pixels [srcInfo, srcBuffer, srcRowbytes] into the 3031105224f9701e57ec5ce0354d6a380b664f5c638Brian Osman * renderTargetContext at the specified position. 3041da3ecd07836a72c9225c896d2516625906b4bdarobertphillips * @param srcInfo image info for the source pixels 3051da3ecd07836a72c9225c896d2516625906b4bdarobertphillips * @param srcBuffer source for the write 3061da3ecd07836a72c9225c896d2516625906b4bdarobertphillips * @param srcRowBytes bytes in a row of 'srcBuffer' 3071105224f9701e57ec5ce0354d6a380b664f5c638Brian Osman * @param x x offset w/in the render target context at which to write 3081105224f9701e57ec5ce0354d6a380b664f5c638Brian Osman * @param y y offset w/in the render target context at which to write 3091da3ecd07836a72c9225c896d2516625906b4bdarobertphillips * 3101da3ecd07836a72c9225c896d2516625906b4bdarobertphillips * @return true if the write succeeded, false if not. The write can fail because of an 3111da3ecd07836a72c9225c896d2516625906b4bdarobertphillips * unsupported pixel config. 3121da3ecd07836a72c9225c896d2516625906b4bdarobertphillips */ 3131da3ecd07836a72c9225c896d2516625906b4bdarobertphillips bool writePixels(const SkImageInfo& srcInfo, const void* srcBuffer, size_t srcRowBytes, 3141da3ecd07836a72c9225c896d2516625906b4bdarobertphillips int x, int y); 3151da3ecd07836a72c9225c896d2516625906b4bdarobertphillips 316976f5f0dc5e907d1ca50685fad117bd15d7fc87brobertphillips bool isStencilBufferMultisampled() const { 317976f5f0dc5e907d1ca50685fad117bd15d7fc87brobertphillips return fRenderTarget->isStencilBufferMultisampled(); 318976f5f0dc5e907d1ca50685fad117bd15d7fc87brobertphillips } 31955fdcccf01d49173bc731024b4283d3a3ea9150arobertphillips bool isUnifiedMultisampled() const { return fRenderTarget->isUnifiedMultisampled(); } 320f9635999a4aa8810d04e8ef04594a9fbcc061e3dcsmartdalton bool hasMixedSamples() const { return fRenderTarget->isMixedSampled(); } 32182ec6e59b8b694c128adcf8590667d37327dd1c4robertphillips 322ecbc12b1c1c72de0cf7bba4a3f6a7cce4f43bf41csmartdalton bool mustUseHWAA(const GrPaint& paint) const { 323bb24383abb724c516e472af4eec68f2c3f17a6d0bsalomon return paint.isAntiAlias() && fRenderTarget->isUnifiedMultisampled(); 324ecbc12b1c1c72de0cf7bba4a3f6a7cce4f43bf41csmartdalton } 325ecbc12b1c1c72de0cf7bba4a3f6a7cce4f43bf41csmartdalton 326faf8203ea7588dcdca82f69f5a5447b3eb53a849bsalomon const GrCaps* caps() const { return fContext->caps(); } 327e576874b162f8c66aa6c2e06cb6bc459ccd8b6f9robertphillips const GrSurfaceDesc& desc() const { return fRenderTarget->desc(); } 3287bceedc550513b13e0065aca66e55204a2ba3e1frobertphillips int width() const { return fRenderTarget->width(); } 3297bceedc550513b13e0065aca66e55204a2ba3e1frobertphillips int height() const { return fRenderTarget->height(); } 330ca6eafc0f7e59ed89f03a9891b9fdf7de64f1f35robertphillips GrPixelConfig config() const { return fRenderTarget->config(); } 3317bceedc550513b13e0065aca66e55204a2ba3e1frobertphillips int numColorSamples() const { return fRenderTarget->numColorSamples(); } 3329dc935fa11521d4a6c7875699c050044a45d0871brianosman bool isGammaCorrect() const { return SkToBool(fColorSpace.get()); } 3338fe485b793f6b3c286700988138e1395b0d33487brianosman SkSourceGammaTreatment sourceGammaTreatment() const { 3348fe485b793f6b3c286700988138e1395b0d33487brianosman return this->isGammaCorrect() ? SkSourceGammaTreatment::kRespect 3358fe485b793f6b3c286700988138e1395b0d33487brianosman : SkSourceGammaTreatment::kIgnore; 3368fe485b793f6b3c286700988138e1395b0d33487brianosman } 337ca6eafc0f7e59ed89f03a9891b9fdf7de64f1f35robertphillips const SkSurfaceProps& surfaceProps() const { return fSurfaceProps; } 338dfe4f2e4fe5b162d4adb4486fe751f1e3b30bea7brianosman SkColorSpace* getColorSpace() const { return fColorSpace.get(); } 339c71a9b7f53938b4f33f36f48e867b8b72cc1cc61msarett GrColorSpaceXform* getColorXformFromSRGB() const { return fColorXformFromSRGB.get(); } 3407e922765545f42ce691e4f3d5fbbd4e44ba47ff1robertphillips GrSurfaceOrigin origin() const { return fRenderTarget->origin(); } 3417bceedc550513b13e0065aca66e55204a2ba3e1frobertphillips 3427761d61876ea479dd9672b684fd5c7601932a767robertphillips bool wasAbandoned() const; 3437761d61876ea479dd9672b684fd5c7601932a767robertphillips 3446c7e325236b7fbb9c9b14ebb4715f88a59718695robertphillips GrRenderTarget* accessRenderTarget() { return fRenderTarget.get(); } 3456c7e325236b7fbb9c9b14ebb4715f88a59718695robertphillips 3466c7e325236b7fbb9c9b14ebb4715f88a59718695robertphillips sk_sp<GrTexture> asTexture() { return sk_ref_sp(fRenderTarget->asTexture()); } 347433625e67c61c3acce4fd95b3881493c9f4f2c7frobertphillips 348391395dcfbff09a83f8f0e9d3e02d38c855ae2e9robertphillips // Provides access to functions that aren't part of the public API. 349693a540272a771c6b0830094c461397cb77543b1Brian Osman GrRenderTargetContextPriv priv(); 350693a540272a771c6b0830094c461397cb77543b1Brian Osman const GrRenderTargetContextPriv priv() const; 351f5883a6d75a18c581507214d3057b5c721ed1ffcjoshualitt 352976f5f0dc5e907d1ca50685fad117bd15d7fc87brobertphillips GrAuditTrail* auditTrail() { return fAuditTrail; } 353976f5f0dc5e907d1ca50685fad117bd15d7fc87brobertphillips 35496880d9e366d58e5960aa0ee6aa67260797679ebjoshualittprotected: 3551105224f9701e57ec5ce0354d6a380b664f5c638Brian Osman GrRenderTargetContext(GrContext*, GrDrawingManager*, sk_sp<GrRenderTarget>, sk_sp<SkColorSpace>, 3561105224f9701e57ec5ce0354d6a380b664f5c638Brian Osman const SkSurfaceProps* surfaceProps, GrAuditTrail*, GrSingleOwner*); 357ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips 35896880d9e366d58e5960aa0ee6aa67260797679ebjoshualitt GrDrawingManager* drawingManager() { return fDrawingManager; } 359ca6eafc0f7e59ed89f03a9891b9fdf7de64f1f35robertphillips 36096880d9e366d58e5960aa0ee6aa67260797679ebjoshualitt SkDEBUGCODE(GrSingleOwner* singleOwner() { return fSingleOwner; }) 3612e1e51f04985f7c258b96f0decc190456f5dd74drobertphillips SkDEBUGCODE(void validate() const;) 362ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips 36396880d9e366d58e5960aa0ee6aa67260797679ebjoshualittprivate: 36496880d9e366d58e5960aa0ee6aa67260797679ebjoshualitt friend class GrAtlasTextBlob; // for access to drawBatch 365193d9cf8f2280cd4f8e509c6f3af6b47cea04935cdalton friend class GrStencilAndCoverTextContext; // for access to drawBatch 36655fdcccf01d49173bc731024b4283d3a3ea9150arobertphillips 36796880d9e366d58e5960aa0ee6aa67260797679ebjoshualitt friend class GrDrawingManager; // for ctor 3681105224f9701e57ec5ce0354d6a380b664f5c638Brian Osman friend class GrRenderTargetContextPriv; 369f2361d2d93c200cd4555b5e8ecea4531801abaaaRobert Phillips friend class GrTestTarget; // for access to getOpList 370976f5f0dc5e907d1ca50685fad117bd15d7fc87brobertphillips friend class GrSWMaskHelper; // for access to drawBatch 371976f5f0dc5e907d1ca50685fad117bd15d7fc87brobertphillips 372976f5f0dc5e907d1ca50685fad117bd15d7fc87brobertphillips // All the path renderers currently make their own batches 373976f5f0dc5e907d1ca50685fad117bd15d7fc87brobertphillips friend class GrSoftwarePathRenderer; // for access to drawBatch 374976f5f0dc5e907d1ca50685fad117bd15d7fc87brobertphillips friend class GrAAConvexPathRenderer; // for access to drawBatch 375976f5f0dc5e907d1ca50685fad117bd15d7fc87brobertphillips friend class GrDashLinePathRenderer; // for access to drawBatch 376976f5f0dc5e907d1ca50685fad117bd15d7fc87brobertphillips friend class GrAAHairLinePathRenderer; // for access to drawBatch 377976f5f0dc5e907d1ca50685fad117bd15d7fc87brobertphillips friend class GrAALinearizingConvexPathRenderer; // for access to drawBatch 378976f5f0dc5e907d1ca50685fad117bd15d7fc87brobertphillips friend class GrAADistanceFieldPathRenderer; // for access to drawBatch 379976f5f0dc5e907d1ca50685fad117bd15d7fc87brobertphillips friend class GrDefaultPathRenderer; // for access to drawBatch 380976f5f0dc5e907d1ca50685fad117bd15d7fc87brobertphillips friend class GrPLSPathRenderer; // for access to drawBatch 381976f5f0dc5e907d1ca50685fad117bd15d7fc87brobertphillips friend class GrMSAAPathRenderer; // for access to drawBatch 382976f5f0dc5e907d1ca50685fad117bd15d7fc87brobertphillips friend class GrStencilAndCoverPathRenderer; // for access to drawBatch 383976f5f0dc5e907d1ca50685fad117bd15d7fc87brobertphillips friend class GrTessellatingPathRenderer; // for access to drawBatch 384ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips 38529df76096fd30941086324902a82656df2d8becdcsmartdalton void internalClear(const GrFixedClip&, const GrColor, bool canIgnoreClip); 38629df76096fd30941086324902a82656df2d8becdcsmartdalton 387000958973f4b514cddbfdcc01ec167437b66de2crobertphillips bool drawFilledDRRect(const GrClip& clip, 388000958973f4b514cddbfdcc01ec167437b66de2crobertphillips const GrPaint& paint, 389000958973f4b514cddbfdcc01ec167437b66de2crobertphillips const SkMatrix& viewMatrix, 390000958973f4b514cddbfdcc01ec167437b66de2crobertphillips const SkRRect& origOuter, 391000958973f4b514cddbfdcc01ec167437b66de2crobertphillips const SkRRect& origInner); 392000958973f4b514cddbfdcc01ec167437b66de2crobertphillips 393443023975e335e3630191227dbc21fa72c436af3robertphillips bool drawFilledRect(const GrClip& clip, 394443023975e335e3630191227dbc21fa72c436af3robertphillips const GrPaint& paint, 395443023975e335e3630191227dbc21fa72c436af3robertphillips const SkMatrix& viewMatrix, 396443023975e335e3630191227dbc21fa72c436af3robertphillips const SkRect& rect, 397443023975e335e3630191227dbc21fa72c436af3robertphillips const GrUserStencilSettings* ss); 398443023975e335e3630191227dbc21fa72c436af3robertphillips 399443023975e335e3630191227dbc21fa72c436af3robertphillips void drawNonAAFilledRect(const GrClip&, 400443023975e335e3630191227dbc21fa72c436af3robertphillips const GrPaint&, 401443023975e335e3630191227dbc21fa72c436af3robertphillips const SkMatrix& viewMatrix, 402443023975e335e3630191227dbc21fa72c436af3robertphillips const SkRect& rect, 403443023975e335e3630191227dbc21fa72c436af3robertphillips const SkRect* localRect, 404443023975e335e3630191227dbc21fa72c436af3robertphillips const SkMatrix* localMatrix, 40534ee0c950e1aa24818632084acdb382514f98c08csmartdalton const GrUserStencilSettings* ss, 40634ee0c950e1aa24818632084acdb382514f98c08csmartdalton bool useHWAA); 407391395dcfbff09a83f8f0e9d3e02d38c855ae2e9robertphillips 4084bc31815ba1aa42ea13c5637c6b52262422b7bdbrobertphillips void internalDrawPath(const GrClip& clip, 4094bc31815ba1aa42ea13c5637c6b52262422b7bdbrobertphillips const GrPaint& paint, 410ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips const SkMatrix& viewMatrix, 4114bc31815ba1aa42ea13c5637c6b52262422b7bdbrobertphillips const SkPath& path, 4126663acff010ce752e4bf778da81fa97448c9db31bsalomon const GrStyle& style); 413ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips 4142334fb655f8d4ef5915770d32bf845c88d3627f4robertphillips // This entry point allows the GrTextContext-derived classes to add their batches to 415f2361d2d93c200cd4555b5e8ecea4531801abaaaRobert Phillips // the GrOpList. 416bb24383abb724c516e472af4eec68f2c3f17a6d0bsalomon void drawBatch(const GrPipelineBuilder& pipelineBuilder, const GrClip&, GrDrawBatch* batch); 4172334fb655f8d4ef5915770d32bf845c88d3627f4robertphillips 418f2361d2d93c200cd4555b5e8ecea4531801abaaaRobert Phillips GrRenderTargetOpList* getOpList(); 419a106c627532ad669cf7d879955ae8ea6a53233c1robertphillips 420c71a9b7f53938b4f33f36f48e867b8b72cc1cc61msarett GrDrawingManager* fDrawingManager; 421c71a9b7f53938b4f33f36f48e867b8b72cc1cc61msarett sk_sp<GrRenderTarget> fRenderTarget; 422a106c627532ad669cf7d879955ae8ea6a53233c1robertphillips 4231105224f9701e57ec5ce0354d6a380b664f5c638Brian Osman // In MDB-mode the GrOpList can be closed by some other renderTargetContext that has picked 424f2361d2d93c200cd4555b5e8ecea4531801abaaaRobert Phillips // it up. For this reason, the GrOpList should only ever be accessed via 'getOpList'. 425f2361d2d93c200cd4555b5e8ecea4531801abaaaRobert Phillips GrRenderTargetOpList* fOpList; 426c71a9b7f53938b4f33f36f48e867b8b72cc1cc61msarett GrContext* fContext; 427c71a9b7f53938b4f33f36f48e867b8b72cc1cc61msarett GrInstancedPipelineInfo fInstancedPipelineInfo; 4282334fb655f8d4ef5915770d32bf845c88d3627f4robertphillips 429c71a9b7f53938b4f33f36f48e867b8b72cc1cc61msarett sk_sp<SkColorSpace> fColorSpace; 430c71a9b7f53938b4f33f36f48e867b8b72cc1cc61msarett sk_sp<GrColorSpaceXform> fColorXformFromSRGB; 431c71a9b7f53938b4f33f36f48e867b8b72cc1cc61msarett SkSurfaceProps fSurfaceProps; 432c71a9b7f53938b4f33f36f48e867b8b72cc1cc61msarett GrAuditTrail* fAuditTrail; 4331de610a5287cf61d4f3a1fdc7413bd74827a8b6ajoshualitt 4341de610a5287cf61d4f3a1fdc7413bd74827a8b6ajoshualitt // In debug builds we guard against improper thread handling 435c71a9b7f53938b4f33f36f48e867b8b72cc1cc61msarett SkDEBUGCODE(mutable GrSingleOwner* fSingleOwner;) 436ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips}; 437ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips 438ea4615034498aca2f9ca1753fb9a1ef10508d8ccrobertphillips#endif 439