blob: d1dc0c43abd09f583a164cc2e9592b35f2c87d09 [file] [log] [blame]
robertphillipsea461502015-05-26 11:38:03 -07001/*
2 * Copyright 2015 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
Brian Osman11052242016-10-27 14:47:55 -04008#ifndef GrRenderTargetContext_DEFINED
9#define GrRenderTargetContext_DEFINED
robertphillipsea461502015-05-26 11:38:03 -070010
11#include "GrColor.h"
bsalomonfaf82032016-09-16 09:53:27 -070012#include "GrContext.h"
csmartdaltonecbc12b2016-06-08 10:08:43 -070013#include "GrPaint.h"
robertphillips7bceedc2015-12-01 12:51:26 -080014#include "GrRenderTarget.h"
robertphillipsea461502015-05-26 11:38:03 -070015#include "SkRefCnt.h"
robertphillips391395d2016-03-02 09:26:36 -080016#include "SkRegion.h"
robertphillipsfcf78292015-06-19 11:49:52 -070017#include "SkSurfaceProps.h"
csmartdaltona7f29642016-07-07 08:49:11 -070018#include "../private/GrInstancedPipelineInfo.h"
joshualitt1de610a2016-01-06 08:26:09 -080019#include "../private/GrSingleOwner.h"
robertphillipsea461502015-05-26 11:38:03 -070020
joshualittbc907352016-01-13 06:45:40 -080021class GrAuditTrail;
robertphillipsea461502015-05-26 11:38:03 -070022class GrClip;
bsalomonabd30f52015-08-13 13:34:48 -070023class GrDrawBatch;
Brian Osman11052242016-10-27 14:47:55 -040024class GrRenderTargetContextPriv;
cdalton8ff8d242015-12-08 10:20:32 -080025class GrDrawPathBatchBase;
robertphillips77a2e522015-10-17 07:43:27 -070026class GrDrawingManager;
csmartdalton29df7602016-08-31 11:55:52 -070027class GrFixedClip;
robertphillipsea461502015-05-26 11:38:03 -070028class GrPaint;
29class GrPathProcessor;
robertphillipsea461502015-05-26 11:38:03 -070030class GrPipelineBuilder;
31class GrRenderTarget;
Robert Phillipsf2361d22016-10-25 14:20:06 -040032class GrRenderTargetOpList;
bsalomon6663acf2016-05-10 09:14:17 -070033class GrStyle;
robertphillipsea461502015-05-26 11:38:03 -070034class GrSurface;
robertphillips44302392016-07-08 14:43:03 -070035struct GrUserStencilSettings;
robertphillips2334fb62015-06-17 05:43:33 -070036class SkDrawFilter;
robertphillipsea461502015-05-26 11:38:03 -070037struct SkIPoint;
38struct SkIRect;
msarett10e3d9b2016-08-18 15:46:03 -070039class SkLatticeIter;
robertphillipsea461502015-05-26 11:38:03 -070040class SkMatrix;
robertphillips2334fb62015-06-17 05:43:33 -070041class SkPaint;
robertphillipsea461502015-05-26 11:38:03 -070042class SkPath;
43struct SkPoint;
44struct SkRect;
45class SkRRect;
jvanverth31ff7622015-08-07 10:09:28 -070046struct SkRSXform;
robertphillips2334fb62015-06-17 05:43:33 -070047class SkTextBlob;
robertphillipsea461502015-05-26 11:38:03 -070048
49/*
50 * A helper object to orchestrate draws
51 */
Brian Osman11052242016-10-27 14:47:55 -040052class SK_API GrRenderTargetContext : public SkRefCnt {
robertphillipsea461502015-05-26 11:38:03 -070053public:
Brian Osman11052242016-10-27 14:47:55 -040054 ~GrRenderTargetContext() override;
robertphillips2334fb62015-06-17 05:43:33 -070055
bsalomonb8fea972016-02-16 07:34:17 -080056 bool copySurface(GrSurface* src, const SkIRect& srcRect, const SkIPoint& dstPoint);
robertphillipsea461502015-05-26 11:38:03 -070057
robertphillips2334fb62015-06-17 05:43:33 -070058 // TODO: it is odd that we need both the SkPaint in the following 3 methods.
59 // We should extract the text parameters from SkPaint and pass them separately
bsalomon6663acf2016-05-10 09:14:17 -070060 // akin to GrStyle (GrTextInfo?)
joshualitt96880d92016-02-16 10:36:53 -080061 virtual void drawText(const GrClip&, const GrPaint&, const SkPaint&,
62 const SkMatrix& viewMatrix, const char text[], size_t byteLength,
63 SkScalar x, SkScalar y, const SkIRect& clipBounds);
64 virtual void drawPosText(const GrClip&, const GrPaint&, const SkPaint&,
65 const SkMatrix& viewMatrix, const char text[], size_t byteLength,
66 const SkScalar pos[], int scalarsPerPosition,
67 const SkPoint& offset, const SkIRect& clipBounds);
68 virtual void drawTextBlob(const GrClip&, const SkPaint&,
69 const SkMatrix& viewMatrix, const SkTextBlob*,
70 SkScalar x, SkScalar y,
71 SkDrawFilter*, const SkIRect& clipBounds);
robertphillipsea461502015-05-26 11:38:03 -070072
robertphillipsea461502015-05-26 11:38:03 -070073 /**
74 * Provides a perfomance hint that the render target's contents are allowed
75 * to become undefined.
76 */
robertphillips2e1e51f2015-10-15 08:01:48 -070077 void discard();
robertphillipsea461502015-05-26 11:38:03 -070078
79 /**
80 * Clear the entire or rect of the render target, ignoring any clips.
robertphillipsea461502015-05-26 11:38:03 -070081 * @param rect the rect to clear or the whole thing if rect is NULL.
82 * @param color the color to clear to.
83 * @param canIgnoreRect allows partial clears to be converted to whole
84 * clears on platforms for which that is cheap
85 */
robertphillips2e1e51f2015-10-15 08:01:48 -070086 void clear(const SkIRect* rect, GrColor color, bool canIgnoreRect);
robertphillipsea461502015-05-26 11:38:03 -070087
88 /**
89 * Draw everywhere (respecting the clip) with the paint.
90 */
robertphillips2e1e51f2015-10-15 08:01:48 -070091 void drawPaint(const GrClip&, const GrPaint&, const SkMatrix& viewMatrix);
robertphillipsea461502015-05-26 11:38:03 -070092
93 /**
94 * Draw the rect using a paint.
95 * @param paint describes how to color pixels.
96 * @param viewMatrix transformation matrix
bsalomon6663acf2016-05-10 09:14:17 -070097 * @param style The style to apply. Null means fill. Currently path effects are not
98 * allowed.
robertphillipsea461502015-05-26 11:38:03 -070099 * The rects coords are used to access the paint (through texture matrix)
100 */
robertphillips2e1e51f2015-10-15 08:01:48 -0700101 void drawRect(const GrClip&,
robertphillipsea461502015-05-26 11:38:03 -0700102 const GrPaint& paint,
103 const SkMatrix& viewMatrix,
104 const SkRect&,
bsalomon6663acf2016-05-10 09:14:17 -0700105 const GrStyle* style = nullptr);
robertphillipsea461502015-05-26 11:38:03 -0700106
107 /**
bsalomona2e69fc2015-11-05 10:41:43 -0800108 * Maps a rectangle of shader coordinates to a rectangle and fills that rectangle.
robertphillipsea461502015-05-26 11:38:03 -0700109 *
110 * @param paint describes how to color pixels.
111 * @param viewMatrix transformation matrix which applies to rectToDraw
112 * @param rectToDraw the rectangle to draw
113 * @param localRect the rectangle of shader coordinates applied to rectToDraw
robertphillipsea461502015-05-26 11:38:03 -0700114 */
bsalomona2e69fc2015-11-05 10:41:43 -0800115 void fillRectToRect(const GrClip&,
116 const GrPaint& paint,
117 const SkMatrix& viewMatrix,
118 const SkRect& rectToDraw,
119 const SkRect& localRect);
robertphillipsea461502015-05-26 11:38:03 -0700120
121 /**
bsalomona2e69fc2015-11-05 10:41:43 -0800122 * Fills a rect with a paint and a localMatrix.
robertphillipsea461502015-05-26 11:38:03 -0700123 */
bsalomona2e69fc2015-11-05 10:41:43 -0800124 void fillRectWithLocalMatrix(const GrClip& clip,
125 const GrPaint& paint,
126 const SkMatrix& viewMatrix,
127 const SkRect& rect,
128 const SkMatrix& localMatrix);
robertphillipsea461502015-05-26 11:38:03 -0700129
130 /**
131 * Draw a roundrect using a paint.
132 *
133 * @param paint describes how to color pixels.
134 * @param viewMatrix transformation matrix
135 * @param rrect the roundrect to draw
bsalomon6663acf2016-05-10 09:14:17 -0700136 * @param style style to apply to the rrect. Currently path effects are not allowed.
robertphillipsea461502015-05-26 11:38:03 -0700137 */
robertphillips2e1e51f2015-10-15 08:01:48 -0700138 void drawRRect(const GrClip&,
robertphillipsea461502015-05-26 11:38:03 -0700139 const GrPaint&,
140 const SkMatrix& viewMatrix,
141 const SkRRect& rrect,
bsalomon6663acf2016-05-10 09:14:17 -0700142 const GrStyle& style);
robertphillipsea461502015-05-26 11:38:03 -0700143
144 /**
robertphillips00095892016-02-29 13:50:40 -0800145 * Shortcut for drawing an SkPath consisting of nested rrects using a paint.
146 * Does not support stroking. The result is undefined if outer does not contain
147 * inner.
148 *
149 * @param paint describes how to color pixels.
150 * @param viewMatrix transformation matrix
151 * @param outer the outer roundrect
152 * @param inner the inner roundrect
153 */
154 void drawDRRect(const GrClip&,
155 const GrPaint&,
156 const SkMatrix& viewMatrix,
157 const SkRRect& outer,
158 const SkRRect& inner);
159
160 /**
robertphillipsea461502015-05-26 11:38:03 -0700161 * Draws a path.
162 *
163 * @param paint describes how to color pixels.
164 * @param viewMatrix transformation matrix
165 * @param path the path to draw
bsalomon6663acf2016-05-10 09:14:17 -0700166 * @param style style to apply to the path.
robertphillipsea461502015-05-26 11:38:03 -0700167 */
robertphillips2e1e51f2015-10-15 08:01:48 -0700168 void drawPath(const GrClip&,
robertphillipsea461502015-05-26 11:38:03 -0700169 const GrPaint&,
170 const SkMatrix& viewMatrix,
171 const SkPath&,
bsalomon6663acf2016-05-10 09:14:17 -0700172 const GrStyle& style);
robertphillipsea461502015-05-26 11:38:03 -0700173
174 /**
175 * Draws vertices with a paint.
176 *
177 * @param paint describes how to color pixels.
178 * @param viewMatrix transformation matrix
179 * @param primitiveType primitives type to draw.
180 * @param vertexCount number of vertices.
181 * @param positions array of vertex positions, required.
182 * @param texCoords optional array of texture coordinates used
183 * to access the paint.
184 * @param colors optional array of per-vertex colors, supercedes
185 * the paint's color field.
186 * @param indices optional array of indices. If NULL vertices
187 * are drawn non-indexed.
188 * @param indexCount if indices is non-null then this is the
189 * number of indices.
190 */
robertphillips2e1e51f2015-10-15 08:01:48 -0700191 void drawVertices(const GrClip&,
robertphillipsea461502015-05-26 11:38:03 -0700192 const GrPaint& paint,
193 const SkMatrix& viewMatrix,
194 GrPrimitiveType primitiveType,
195 int vertexCount,
196 const SkPoint positions[],
197 const SkPoint texs[],
198 const GrColor colors[],
199 const uint16_t indices[],
200 int indexCount);
201
202 /**
jvanverth31ff7622015-08-07 10:09:28 -0700203 * Draws textured sprites from an atlas with a paint.
204 *
205 * @param paint describes how to color pixels.
206 * @param viewMatrix transformation matrix
207 * @param spriteCount number of sprites.
208 * @param xform array of compressed transformation data, required.
209 * @param texRect array of texture rectangles used to access the paint.
210 * @param colors optional array of per-sprite colors, supercedes
211 * the paint's color field.
212 */
robertphillips2e1e51f2015-10-15 08:01:48 -0700213 void drawAtlas(const GrClip&,
jvanverth31ff7622015-08-07 10:09:28 -0700214 const GrPaint& paint,
215 const SkMatrix& viewMatrix,
216 int spriteCount,
217 const SkRSXform xform[],
218 const SkRect texRect[],
219 const SkColor colors[]);
msarettcc319b92016-08-25 18:07:18 -0700220
221 /**
222 * Draws a region.
223 *
224 * @param paint describes how to color pixels
225 * @param viewMatrix transformation matrix
226 * @param region the region to be drawn
227 * @param style style to apply to the region
228 */
229 void drawRegion(const GrClip&,
230 const GrPaint& paint,
231 const SkMatrix& viewMatrix,
232 const SkRegion& region,
233 const GrStyle& style);
234
jvanverth31ff7622015-08-07 10:09:28 -0700235 /**
robertphillipsea461502015-05-26 11:38:03 -0700236 * Draws an oval.
237 *
238 * @param paint describes how to color pixels.
239 * @param viewMatrix transformation matrix
240 * @param oval the bounding rect of the oval.
bsalomon6663acf2016-05-10 09:14:17 -0700241 * @param style style to apply to the oval. Currently path effects are not allowed.
robertphillipsea461502015-05-26 11:38:03 -0700242 */
robertphillips2e1e51f2015-10-15 08:01:48 -0700243 void drawOval(const GrClip&,
robertphillipsea461502015-05-26 11:38:03 -0700244 const GrPaint& paint,
245 const SkMatrix& viewMatrix,
246 const SkRect& oval,
bsalomon6663acf2016-05-10 09:14:17 -0700247 const GrStyle& style);
bsalomon4f3a0ca2016-08-22 13:14:26 -0700248 /**
249 * Draws a partial arc of an oval.
250 *
251 * @param paint describes how to color pixels.
252 * @param viewMatrix transformation matrix.
253 * @param oval the bounding rect of the oval.
254 * @param startAngle starting angle in degrees.
255 * @param sweepAngle angle to sweep in degrees. Must be in (-360, 360)
256 * @param useCenter true means that the implied path begins at the oval center, connects as a
257 * line to the point indicated by the start contains the arc indicated by
258 * the sweep angle. If false the line beginning at the center point is
259 * omitted.
260 * @param style style to apply to the oval.
261 */
262 void drawArc(const GrClip&,
263 const GrPaint& paint,
264 const SkMatrix& viewMatrix,
265 const SkRect& oval,
266 SkScalar startAngle,
267 SkScalar sweepAngle,
268 bool useCenter,
269 const GrStyle& style);
robertphillipsea461502015-05-26 11:38:03 -0700270
joshualitt33a5fce2015-11-18 13:28:51 -0800271 /**
bsalomon4f3a0ca2016-08-22 13:14:26 -0700272 * Draw the image as a set of rects, specified by |iter|.
joshualitt33a5fce2015-11-18 13:28:51 -0800273 */
msarett10e3d9b2016-08-18 15:46:03 -0700274 void drawImageLattice(const GrClip&,
275 const GrPaint& paint,
276 const SkMatrix& viewMatrix,
277 int imageWidth,
278 int imageHeight,
279 std::unique_ptr<SkLatticeIter> iter,
280 const SkRect& dst);
robertphillipsea461502015-05-26 11:38:03 -0700281
robertphillips8c523e02016-07-26 07:41:00 -0700282 /**
283 * After this returns any pending surface IO will be issued to the backend 3D API and
284 * if the surface has MSAA it will be resolved.
285 */
286 void prepareForExternalIO();
287
robertphillips1da3ecd2016-08-31 14:54:15 -0700288 /**
Brian Osman11052242016-10-27 14:47:55 -0400289 * Reads a rectangle of pixels from the render target context.
robertphillips1da3ecd2016-08-31 14:54:15 -0700290 * @param dstInfo image info for the destination
291 * @param dstBuffer destination pixels for the read
292 * @param dstRowBytes bytes in a row of 'dstBuffer'
Brian Osman11052242016-10-27 14:47:55 -0400293 * @param x x offset w/in the render target context from which to read
294 * @param y y offset w/in the render target context from which to read
robertphillips1da3ecd2016-08-31 14:54:15 -0700295 *
296 * @return true if the read succeeded, false if not. The read can fail because of an
297 * unsupported pixel config.
298 */
299 bool readPixels(const SkImageInfo& dstInfo, void* dstBuffer, size_t dstRowBytes, int x, int y);
300
301 /**
302 * Writes a rectangle of pixels [srcInfo, srcBuffer, srcRowbytes] into the
Brian Osman11052242016-10-27 14:47:55 -0400303 * renderTargetContext at the specified position.
robertphillips1da3ecd2016-08-31 14:54:15 -0700304 * @param srcInfo image info for the source pixels
305 * @param srcBuffer source for the write
306 * @param srcRowBytes bytes in a row of 'srcBuffer'
Brian Osman11052242016-10-27 14:47:55 -0400307 * @param x x offset w/in the render target context at which to write
308 * @param y y offset w/in the render target context at which to write
robertphillips1da3ecd2016-08-31 14:54:15 -0700309 *
310 * @return true if the write succeeded, false if not. The write can fail because of an
311 * unsupported pixel config.
312 */
313 bool writePixels(const SkImageInfo& srcInfo, const void* srcBuffer, size_t srcRowBytes,
314 int x, int y);
315
robertphillips976f5f02016-06-03 10:59:20 -0700316 bool isStencilBufferMultisampled() const {
317 return fRenderTarget->isStencilBufferMultisampled();
318 }
robertphillips55fdccc2016-06-06 06:16:20 -0700319 bool isUnifiedMultisampled() const { return fRenderTarget->isUnifiedMultisampled(); }
csmartdaltonf9635992016-08-10 11:09:07 -0700320 bool hasMixedSamples() const { return fRenderTarget->isMixedSampled(); }
robertphillips82ec6e52016-05-19 14:01:05 -0700321
csmartdaltonecbc12b2016-06-08 10:08:43 -0700322 bool mustUseHWAA(const GrPaint& paint) const {
bsalomonbb243832016-07-22 07:10:19 -0700323 return paint.isAntiAlias() && fRenderTarget->isUnifiedMultisampled();
csmartdaltonecbc12b2016-06-08 10:08:43 -0700324 }
325
bsalomonfaf82032016-09-16 09:53:27 -0700326 const GrCaps* caps() const { return fContext->caps(); }
robertphillipse5768742016-05-13 11:20:46 -0700327 const GrSurfaceDesc& desc() const { return fRenderTarget->desc(); }
robertphillips7bceedc2015-12-01 12:51:26 -0800328 int width() const { return fRenderTarget->width(); }
329 int height() const { return fRenderTarget->height(); }
robertphillipsca6eafc2016-05-17 09:57:46 -0700330 GrPixelConfig config() const { return fRenderTarget->config(); }
robertphillips7bceedc2015-12-01 12:51:26 -0800331 int numColorSamples() const { return fRenderTarget->numColorSamples(); }
brianosman9dc935f2016-07-26 10:21:54 -0700332 bool isGammaCorrect() const { return SkToBool(fColorSpace.get()); }
brianosman8fe485b2016-07-25 12:31:51 -0700333 SkSourceGammaTreatment sourceGammaTreatment() const {
334 return this->isGammaCorrect() ? SkSourceGammaTreatment::kRespect
335 : SkSourceGammaTreatment::kIgnore;
336 }
robertphillipsca6eafc2016-05-17 09:57:46 -0700337 const SkSurfaceProps& surfaceProps() const { return fSurfaceProps; }
brianosmandfe4f2e2016-07-21 13:28:36 -0700338 SkColorSpace* getColorSpace() const { return fColorSpace.get(); }
msarettc71a9b72016-09-16 11:01:27 -0700339 GrColorSpaceXform* getColorXformFromSRGB() const { return fColorXformFromSRGB.get(); }
robertphillips7e922762016-07-26 11:38:17 -0700340 GrSurfaceOrigin origin() const { return fRenderTarget->origin(); }
robertphillips7bceedc2015-12-01 12:51:26 -0800341
robertphillips7761d612016-05-16 09:14:53 -0700342 bool wasAbandoned() const;
343
robertphillips6c7e3252016-04-27 10:47:51 -0700344 GrRenderTarget* accessRenderTarget() { return fRenderTarget.get(); }
345
robertphillips6c7e3252016-04-27 10:47:51 -0700346 sk_sp<GrTexture> asTexture() { return sk_ref_sp(fRenderTarget->asTexture()); }
robertphillips433625e2015-12-04 06:58:16 -0800347
robertphillips391395d2016-03-02 09:26:36 -0800348 // Provides access to functions that aren't part of the public API.
Brian Osman693a5402016-10-27 15:13:22 -0400349 GrRenderTargetContextPriv priv();
350 const GrRenderTargetContextPriv priv() const;
joshualittf5883a62016-01-13 07:47:38 -0800351
robertphillips976f5f02016-06-03 10:59:20 -0700352 GrAuditTrail* auditTrail() { return fAuditTrail; }
353
joshualitt96880d92016-02-16 10:36:53 -0800354protected:
Brian Osman11052242016-10-27 14:47:55 -0400355 GrRenderTargetContext(GrContext*, GrDrawingManager*, sk_sp<GrRenderTarget>, sk_sp<SkColorSpace>,
356 const SkSurfaceProps* surfaceProps, GrAuditTrail*, GrSingleOwner*);
joshualitt96880d92016-02-16 10:36:53 -0800357
358 GrDrawingManager* drawingManager() { return fDrawingManager; }
robertphillipsca6eafc2016-05-17 09:57:46 -0700359
joshualitt96880d92016-02-16 10:36:53 -0800360 SkDEBUGCODE(GrSingleOwner* singleOwner() { return fSingleOwner; })
361 SkDEBUGCODE(void validate() const;)
362
robertphillipsea461502015-05-26 11:38:03 -0700363private:
joshualitt2e2202e2015-12-10 11:22:08 -0800364 friend class GrAtlasTextBlob; // for access to drawBatch
cdalton193d9cf2016-05-12 11:52:02 -0700365 friend class GrStencilAndCoverTextContext; // for access to drawBatch
robertphillips55fdccc2016-06-06 06:16:20 -0700366
robertphillips77a2e522015-10-17 07:43:27 -0700367 friend class GrDrawingManager; // for ctor
Brian Osman11052242016-10-27 14:47:55 -0400368 friend class GrRenderTargetContextPriv;
Robert Phillipsf2361d22016-10-25 14:20:06 -0400369 friend class GrTestTarget; // for access to getOpList
robertphillips976f5f02016-06-03 10:59:20 -0700370 friend class GrSWMaskHelper; // for access to drawBatch
robertphillips976f5f02016-06-03 10:59:20 -0700371
372 // All the path renderers currently make their own batches
373 friend class GrSoftwarePathRenderer; // for access to drawBatch
374 friend class GrAAConvexPathRenderer; // for access to drawBatch
375 friend class GrDashLinePathRenderer; // for access to drawBatch
376 friend class GrAAHairLinePathRenderer; // for access to drawBatch
377 friend class GrAALinearizingConvexPathRenderer; // for access to drawBatch
378 friend class GrAADistanceFieldPathRenderer; // for access to drawBatch
379 friend class GrDefaultPathRenderer; // for access to drawBatch
380 friend class GrPLSPathRenderer; // for access to drawBatch
381 friend class GrMSAAPathRenderer; // for access to drawBatch
382 friend class GrStencilAndCoverPathRenderer; // for access to drawBatch
383 friend class GrTessellatingPathRenderer; // for access to drawBatch
robertphillipsea461502015-05-26 11:38:03 -0700384
csmartdalton29df7602016-08-31 11:55:52 -0700385 void internalClear(const GrFixedClip&, const GrColor, bool canIgnoreClip);
386
robertphillips00095892016-02-29 13:50:40 -0800387 bool drawFilledDRRect(const GrClip& clip,
388 const GrPaint& paint,
389 const SkMatrix& viewMatrix,
390 const SkRRect& origOuter,
391 const SkRRect& origInner);
392
robertphillips44302392016-07-08 14:43:03 -0700393 bool drawFilledRect(const GrClip& clip,
394 const GrPaint& paint,
395 const SkMatrix& viewMatrix,
396 const SkRect& rect,
397 const GrUserStencilSettings* ss);
398
399 void drawNonAAFilledRect(const GrClip&,
400 const GrPaint&,
401 const SkMatrix& viewMatrix,
402 const SkRect& rect,
403 const SkRect* localRect,
404 const SkMatrix* localMatrix,
csmartdalton34ee0c92016-07-27 13:22:27 -0700405 const GrUserStencilSettings* ss,
406 bool useHWAA);
robertphillips391395d2016-03-02 09:26:36 -0800407
robertphillips4bc31812016-03-01 12:22:49 -0800408 void internalDrawPath(const GrClip& clip,
409 const GrPaint& paint,
robertphillipsea461502015-05-26 11:38:03 -0700410 const SkMatrix& viewMatrix,
robertphillips4bc31812016-03-01 12:22:49 -0800411 const SkPath& path,
bsalomon6663acf2016-05-10 09:14:17 -0700412 const GrStyle& style);
robertphillipsea461502015-05-26 11:38:03 -0700413
robertphillips2334fb62015-06-17 05:43:33 -0700414 // This entry point allows the GrTextContext-derived classes to add their batches to
Robert Phillipsf2361d22016-10-25 14:20:06 -0400415 // the GrOpList.
bsalomonbb243832016-07-22 07:10:19 -0700416 void drawBatch(const GrPipelineBuilder& pipelineBuilder, const GrClip&, GrDrawBatch* batch);
robertphillips2334fb62015-06-17 05:43:33 -0700417
Robert Phillipsf2361d22016-10-25 14:20:06 -0400418 GrRenderTargetOpList* getOpList();
robertphillipsa106c622015-10-16 09:07:06 -0700419
msarettc71a9b72016-09-16 11:01:27 -0700420 GrDrawingManager* fDrawingManager;
421 sk_sp<GrRenderTarget> fRenderTarget;
robertphillipsa106c622015-10-16 09:07:06 -0700422
Brian Osman11052242016-10-27 14:47:55 -0400423 // In MDB-mode the GrOpList can be closed by some other renderTargetContext that has picked
Robert Phillipsf2361d22016-10-25 14:20:06 -0400424 // it up. For this reason, the GrOpList should only ever be accessed via 'getOpList'.
425 GrRenderTargetOpList* fOpList;
msarettc71a9b72016-09-16 11:01:27 -0700426 GrContext* fContext;
427 GrInstancedPipelineInfo fInstancedPipelineInfo;
robertphillips2334fb62015-06-17 05:43:33 -0700428
msarettc71a9b72016-09-16 11:01:27 -0700429 sk_sp<SkColorSpace> fColorSpace;
430 sk_sp<GrColorSpaceXform> fColorXformFromSRGB;
431 SkSurfaceProps fSurfaceProps;
432 GrAuditTrail* fAuditTrail;
joshualitt1de610a2016-01-06 08:26:09 -0800433
434 // In debug builds we guard against improper thread handling
msarettc71a9b72016-09-16 11:01:27 -0700435 SkDEBUGCODE(mutable GrSingleOwner* fSingleOwner;)
robertphillipsea461502015-05-26 11:38:03 -0700436};
437
438#endif