blob: 6a1c1dd5c95994460e4e478ada6c61024a44d8e2 [file] [log] [blame]
epoger@google.comec3ed6a2011-07-28 14:26:00 +00001
reed@google.comac10a2d2010-12-22 21:39:39 +00002/*
epoger@google.comec3ed6a2011-07-28 14:26:00 +00003 * Copyright 2010 Google Inc.
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
reed@google.comac10a2d2010-12-22 21:39:39 +00007 */
8
epoger@google.comec3ed6a2011-07-28 14:26:00 +00009
reed@google.comac10a2d2010-12-22 21:39:39 +000010#include "GrGpu.h"
bsalomon@google.com558a75b2011-08-08 17:01:14 +000011
bsalomoneb1cb5c2015-05-22 08:01:09 -070012#include "GrCaps.h"
bsalomon@google.com558a75b2011-08-08 17:01:14 +000013#include "GrContext.h"
bsalomon3582d3e2015-02-13 14:20:05 -080014#include "GrGpuResourcePriv.h"
reed@google.comac10a2d2010-12-22 21:39:39 +000015#include "GrIndexBuffer.h"
kkinnunencabe20c2015-06-01 01:37:26 -070016#include "GrPathRendering.h"
bsalomoncb02b382015-08-12 11:14:50 -070017#include "GrPipeline.h"
bsalomon0ea80f42015-02-11 10:49:59 -080018#include "GrResourceCache.h"
bsalomon6bc1b5f2015-02-23 09:06:38 -080019#include "GrRenderTargetPriv.h"
egdaniel8dc7c3a2015-04-16 11:22:42 -070020#include "GrStencilAttachment.h"
egdaniel6d901da2015-07-30 12:02:15 -070021#include "GrSurfacePriv.h"
bsalomon@google.com81c3f8d2011-08-03 15:18:33 +000022#include "GrVertexBuffer.h"
bsalomoncb8979d2015-05-05 09:51:38 -070023#include "GrVertices.h"
24
25GrVertices& GrVertices::operator =(const GrVertices& di) {
26 fPrimitiveType = di.fPrimitiveType;
27 fStartVertex = di.fStartVertex;
28 fStartIndex = di.fStartIndex;
29 fVertexCount = di.fVertexCount;
30 fIndexCount = di.fIndexCount;
31
32 fInstanceCount = di.fInstanceCount;
33 fVerticesPerInstance = di.fVerticesPerInstance;
34 fIndicesPerInstance = di.fIndicesPerInstance;
bsalomone64eb572015-05-07 11:35:55 -070035 fMaxInstancesPerDraw = di.fMaxInstancesPerDraw;
bsalomoncb8979d2015-05-05 09:51:38 -070036
37 fVertexBuffer.reset(di.vertexBuffer());
38 fIndexBuffer.reset(di.indexBuffer());
39
40 return *this;
41}
bsalomon@google.com1c13c962011-02-14 16:51:21 +000042
bsalomon@google.comd302f142011-03-03 13:54:13 +000043////////////////////////////////////////////////////////////////////////////////
reed@google.comac10a2d2010-12-22 21:39:39 +000044
bsalomon@google.com6e4e6502013-02-25 20:12:45 +000045GrGpu::GrGpu(GrContext* context)
joshualitt3322fa42014-11-07 08:48:51 -080046 : fResetTimestamp(kExpiredTimestamp+1)
bsalomon@google.com0a208a12013-06-28 18:57:35 +000047 , fResetBits(kAll_GrBackendState)
hendrikwf72558e2015-03-04 06:22:18 -080048 , fGpuTraceMarkerCount(0)
joshualitt3322fa42014-11-07 08:48:51 -080049 , fContext(context) {
reed@google.comac10a2d2010-12-22 21:39:39 +000050}
51
bsalomoned0bcad2015-05-04 10:36:42 -070052GrGpu::~GrGpu() {}
bsalomon1d89ddc2014-08-19 14:20:58 -070053
robertphillipse3371302014-09-17 06:01:06 -070054void GrGpu::contextAbandoned() {}
reed@google.comac10a2d2010-12-22 21:39:39 +000055
bsalomon@google.comd302f142011-03-03 13:54:13 +000056////////////////////////////////////////////////////////////////////////////////
reed@google.comac10a2d2010-12-22 21:39:39 +000057
egdanielcf614fd2015-04-22 13:58:58 -070058static GrSurfaceOrigin resolve_origin(GrSurfaceOrigin origin, bool renderTarget) {
egdanielb0e1be22015-04-22 13:27:39 -070059 // By default, GrRenderTargets are GL's normal orientation so that they
60 // can be drawn to by the outside world without the client having
61 // to render upside down.
62 if (kDefault_GrSurfaceOrigin == origin) {
63 return renderTarget ? kBottomLeft_GrSurfaceOrigin : kTopLeft_GrSurfaceOrigin;
64 } else {
65 return origin;
66 }
67}
68
egdanielb0e1be22015-04-22 13:27:39 -070069GrTexture* GrGpu::createTexture(const GrSurfaceDesc& origDesc, bool budgeted,
bsalomon@google.coma7f84e12011-03-10 14:13:19 +000070 const void* srcData, size_t rowBytes) {
egdanielb0e1be22015-04-22 13:27:39 -070071 GrSurfaceDesc desc = origDesc;
72
krajcevski9c0e6292014-06-02 07:38:14 -070073 if (!this->caps()->isConfigTexturable(desc.fConfig)) {
robertphillips@google.comd3eb3362012-10-31 13:56:35 +000074 return NULL;
75 }
krajcevski9c0e6292014-06-02 07:38:14 -070076
bsalomondb558dd2015-01-23 13:19:00 -080077 bool isRT = SkToBool(desc.fFlags & kRenderTarget_GrSurfaceFlag);
78 if (isRT && !this->caps()->isConfigRenderable(desc.fConfig, desc.fSampleCnt > 0)) {
commit-bot@chromium.org6b7938f2013-10-15 14:18:16 +000079 return NULL;
80 }
robertphillips@google.comd3eb3362012-10-31 13:56:35 +000081
robertphillips6e83ac72015-08-13 05:19:14 -070082 // We currently do not support multisampled textures
egdaniel8c9b6f12015-05-12 13:36:30 -070083 if (!isRT && desc.fSampleCnt > 0) {
84 return NULL;
85 }
86
krajcevski9c0e6292014-06-02 07:38:14 -070087 GrTexture *tex = NULL;
egdanielb0e1be22015-04-22 13:27:39 -070088
89 if (isRT) {
90 int maxRTSize = this->caps()->maxRenderTargetSize();
91 if (desc.fWidth > maxRTSize || desc.fHeight > maxRTSize) {
92 return NULL;
93 }
94 } else {
95 int maxSize = this->caps()->maxTextureSize();
96 if (desc.fWidth > maxSize || desc.fHeight > maxSize) {
97 return NULL;
98 }
99 }
100
101 GrGpuResource::LifeCycle lifeCycle = budgeted ? GrGpuResource::kCached_LifeCycle :
102 GrGpuResource::kUncached_LifeCycle;
103
104 desc.fSampleCnt = SkTMin(desc.fSampleCnt, this->caps()->maxSampleCount());
105 // Attempt to catch un- or wrongly initialized sample counts;
106 SkASSERT(desc.fSampleCnt >= 0 && desc.fSampleCnt <= 64);
107
108 desc.fOrigin = resolve_origin(desc.fOrigin, isRT);
109
krajcevski9c0e6292014-06-02 07:38:14 -0700110 if (GrPixelConfigIsCompressed(desc.fConfig)) {
111 // We shouldn't be rendering into this
egdanielb0e1be22015-04-22 13:27:39 -0700112 SkASSERT(!isRT);
113 SkASSERT(0 == desc.fSampleCnt);
krajcevski9c0e6292014-06-02 07:38:14 -0700114
115 if (!this->caps()->npotTextureTileSupport() &&
tfarinaf9dae782014-06-06 06:35:28 -0700116 (!SkIsPow2(desc.fWidth) || !SkIsPow2(desc.fHeight))) {
bsalomon@google.com81c3f8d2011-08-03 15:18:33 +0000117 return NULL;
118 }
tfarinaf9dae782014-06-06 06:35:28 -0700119
krajcevski9c0e6292014-06-02 07:38:14 -0700120 this->handleDirtyContext();
egdanielb0e1be22015-04-22 13:27:39 -0700121 tex = this->onCreateCompressedTexture(desc, lifeCycle, srcData);
krajcevski9c0e6292014-06-02 07:38:14 -0700122 } else {
123 this->handleDirtyContext();
egdanielb0e1be22015-04-22 13:27:39 -0700124 tex = this->onCreateTexture(desc, lifeCycle, srcData, rowBytes);
bsalomon@google.com81c3f8d2011-08-03 15:18:33 +0000125 }
bsalomondb558dd2015-01-23 13:19:00 -0800126 if (!this->caps()->reuseScratchTextures() && !isRT) {
bsalomon3582d3e2015-02-13 14:20:05 -0800127 tex->resourcePriv().removeScratchKey();
bsalomondb558dd2015-01-23 13:19:00 -0800128 }
bsalomonb12ea412015-02-02 21:19:50 -0800129 if (tex) {
130 fStats.incTextureCreates();
131 if (srcData) {
132 fStats.incTextureUploads();
133 }
134 }
bsalomon@google.com81c3f8d2011-08-03 15:18:33 +0000135 return tex;
136}
137
egdaniel8dc7c3a2015-04-16 11:22:42 -0700138bool GrGpu::attachStencilAttachmentToRenderTarget(GrRenderTarget* rt) {
139 SkASSERT(NULL == rt->renderTargetPriv().getStencilAttachment());
bsalomon02a44a42015-02-19 09:09:00 -0800140 GrUniqueKey sbKey;
bsalomond08ea5f2015-02-20 06:58:13 -0800141
142 int width = rt->width();
143 int height = rt->height();
robertphillipsca75ea82015-03-20 06:43:11 -0700144#if 0
bsalomond08ea5f2015-02-20 06:58:13 -0800145 if (this->caps()->oversizedStencilSupport()) {
146 width = SkNextPow2(width);
147 height = SkNextPow2(height);
148 }
robertphillipsca75ea82015-03-20 06:43:11 -0700149#endif
bsalomond08ea5f2015-02-20 06:58:13 -0800150
vbuzinovdded6962015-06-12 08:59:45 -0700151 GrStencilAttachment::ComputeSharedStencilAttachmentKey(width, height,
152 rt->numStencilSamples(), &sbKey);
egdaniel8dc7c3a2015-04-16 11:22:42 -0700153 SkAutoTUnref<GrStencilAttachment> sb(static_cast<GrStencilAttachment*>(
bsalomon02a44a42015-02-19 09:09:00 -0800154 this->getContext()->getResourceCache()->findAndRefUniqueResource(sbKey)));
bsalomon49f085d2014-09-05 13:34:00 -0700155 if (sb) {
egdaniel8dc7c3a2015-04-16 11:22:42 -0700156 if (this->attachStencilAttachmentToRenderTarget(sb, rt)) {
157 rt->renderTargetPriv().didAttachStencilAttachment(sb);
bsalomon6bc1b5f2015-02-23 09:06:38 -0800158 return true;
bsalomon@google.com558a75b2011-08-08 17:01:14 +0000159 }
bsalomon6bc1b5f2015-02-23 09:06:38 -0800160 return false;
bsalomon@google.com558a75b2011-08-08 17:01:14 +0000161 }
egdaniel8dc7c3a2015-04-16 11:22:42 -0700162 if (this->createStencilAttachmentForRenderTarget(rt, width, height)) {
egdanieldf603552015-03-18 13:26:11 -0700163 // Right now we're clearing the stencil buffer here after it is
164 // attached to an RT for the first time. When we start matching
165 // stencil buffers with smaller color targets this will no longer
166 // be correct because it won't be guaranteed to clear the entire
167 // sb.
168 // We used to clear down in the GL subclass using a special purpose
169 // FBO. But iOS doesn't allow a stencil-only FBO. It reports unsupported
170 // FBO status.
171 this->clearStencil(rt);
egdaniel8dc7c3a2015-04-16 11:22:42 -0700172 GrStencilAttachment* sb = rt->renderTargetPriv().getStencilAttachment();
bsalomon6bc1b5f2015-02-23 09:06:38 -0800173 sb->resourcePriv().setUniqueKey(sbKey);
bsalomon@google.com558a75b2011-08-08 17:01:14 +0000174 return true;
175 } else {
176 return false;
bsalomon@google.comedc177d2011-08-05 15:46:40 +0000177 }
bsalomon@google.coma7f84e12011-03-10 14:13:19 +0000178}
179
bsalomon6dc6f5f2015-06-18 09:12:16 -0700180GrTexture* GrGpu::wrapBackendTexture(const GrBackendTextureDesc& desc, GrWrapOwnership ownership) {
bsalomon@google.come269f212011-11-07 13:29:52 +0000181 this->handleDirtyContext();
bsalomon6dc6f5f2015-06-18 09:12:16 -0700182 GrTexture* tex = this->onWrapBackendTexture(desc, ownership);
bsalomon@google.coma14dd6d2012-01-03 21:08:12 +0000183 if (NULL == tex) {
184 return NULL;
185 }
bsalomon@google.come269f212011-11-07 13:29:52 +0000186 // TODO: defer this and attach dynamically
187 GrRenderTarget* tgt = tex->asRenderTarget();
egdaniel8dc7c3a2015-04-16 11:22:42 -0700188 if (tgt && !this->attachStencilAttachmentToRenderTarget(tgt)) {
bsalomon@google.come269f212011-11-07 13:29:52 +0000189 tex->unref();
190 return NULL;
191 } else {
192 return tex;
193 }
194}
195
bsalomon6dc6f5f2015-06-18 09:12:16 -0700196GrRenderTarget* GrGpu::wrapBackendRenderTarget(const GrBackendRenderTargetDesc& desc,
197 GrWrapOwnership ownership) {
bsalomon@google.come269f212011-11-07 13:29:52 +0000198 this->handleDirtyContext();
bsalomon6dc6f5f2015-06-18 09:12:16 -0700199 return this->onWrapBackendRenderTarget(desc, ownership);
bsalomon@google.come269f212011-11-07 13:29:52 +0000200}
201
robertphillips@google.comadacc702013-10-14 21:53:24 +0000202GrVertexBuffer* GrGpu::createVertexBuffer(size_t size, bool dynamic) {
bsalomon@google.coma7f84e12011-03-10 14:13:19 +0000203 this->handleDirtyContext();
robertphillips1b8e1b52015-06-24 06:54:10 -0700204 GrVertexBuffer* vb = this->onCreateVertexBuffer(size, dynamic);
205 if (!this->caps()->reuseScratchBuffers()) {
206 vb->resourcePriv().removeScratchKey();
207 }
208 return vb;
bsalomon@google.coma7f84e12011-03-10 14:13:19 +0000209}
210
robertphillips@google.comadacc702013-10-14 21:53:24 +0000211GrIndexBuffer* GrGpu::createIndexBuffer(size_t size, bool dynamic) {
bsalomon@google.coma7f84e12011-03-10 14:13:19 +0000212 this->handleDirtyContext();
robertphillips1b8e1b52015-06-24 06:54:10 -0700213 GrIndexBuffer* ib = this->onCreateIndexBuffer(size, dynamic);
214 if (!this->caps()->reuseScratchBuffers()) {
215 ib->resourcePriv().removeScratchKey();
216 }
217 return ib;
bsalomon@google.coma7f84e12011-03-10 14:13:19 +0000218}
219
egdaniel51c8d402015-08-06 10:54:13 -0700220void GrGpu::clear(const SkIRect& rect,
joshualitt3322fa42014-11-07 08:48:51 -0800221 GrColor color,
joshualitt3322fa42014-11-07 08:48:51 -0800222 GrRenderTarget* renderTarget) {
bsalomon89c62982014-11-03 12:08:42 -0800223 SkASSERT(renderTarget);
egdaniel51c8d402015-08-06 10:54:13 -0700224 SkASSERT(SkIRect::MakeWH(renderTarget->width(), renderTarget->height()).contains(rect));
bsalomon@google.coma7f84e12011-03-10 14:13:19 +0000225 this->handleDirtyContext();
egdaniel51c8d402015-08-06 10:54:13 -0700226 this->onClear(renderTarget, rect, color);
bsalomon@google.coma7f84e12011-03-10 14:13:19 +0000227}
228
joshualitt6db519c2014-10-29 08:48:18 -0700229void GrGpu::clearStencilClip(const SkIRect& rect,
230 bool insideClip,
231 GrRenderTarget* renderTarget) {
joshualittd53a8272014-11-10 16:03:14 -0800232 SkASSERT(renderTarget);
joshualitt6db519c2014-10-29 08:48:18 -0700233 this->handleDirtyContext();
234 this->onClearStencilClip(renderTarget, rect, insideClip);
235}
236
joshualitt1cbdcde2015-08-21 11:53:29 -0700237bool GrGpu::copySurface(GrSurface* dst,
238 GrSurface* src,
239 const SkIRect& srcRect,
240 const SkIPoint& dstPoint) {
241 SkASSERT(dst && src);
242 this->handleDirtyContext();
243 return this->onCopySurface(dst, src, srcRect, dstPoint);
244}
245
bsalomonf0674512015-07-28 13:26:15 -0700246bool GrGpu::getReadPixelsInfo(GrSurface* srcSurface, int width, int height, size_t rowBytes,
247 GrPixelConfig readConfig, DrawPreference* drawPreference,
248 ReadPixelTempDrawInfo* tempDrawInfo) {
249 SkASSERT(drawPreference);
250 SkASSERT(tempDrawInfo);
251 SkASSERT(kGpuPrefersDraw_DrawPreference != *drawPreference);
252
egdaniel6d901da2015-07-30 12:02:15 -0700253 // We currently do not support reading into a compressed buffer
254 if (GrPixelConfigIsCompressed(readConfig)) {
255 return false;
256 }
257
bsalomonf0674512015-07-28 13:26:15 -0700258 if (!this->onGetReadPixelsInfo(srcSurface, width, height, rowBytes, readConfig, drawPreference,
259 tempDrawInfo)) {
260 return false;
261 }
262
263 // Check to see if we're going to request that the caller draw when drawing is not possible.
264 if (!srcSurface->asTexture() ||
265 !this->caps()->isConfigRenderable(tempDrawInfo->fTempSurfaceDesc.fConfig, false)) {
266 // If we don't have a fallback to a straight read then fail.
267 if (kRequireDraw_DrawPreference == *drawPreference) {
268 return false;
269 }
270 *drawPreference = kNoDraw_DrawPreference;
271 }
272
273 return true;
274}
275bool GrGpu::getWritePixelsInfo(GrSurface* dstSurface, int width, int height, size_t rowBytes,
276 GrPixelConfig srcConfig, DrawPreference* drawPreference,
277 WritePixelTempDrawInfo* tempDrawInfo) {
278 SkASSERT(drawPreference);
279 SkASSERT(tempDrawInfo);
280 SkASSERT(kGpuPrefersDraw_DrawPreference != *drawPreference);
281
282 if (this->caps()->useDrawInsteadOfPartialRenderTargetWrite() &&
283 SkToBool(dstSurface->asRenderTarget()) &&
284 (width < dstSurface->width() || height < dstSurface->height())) {
285 ElevateDrawPreference(drawPreference, kRequireDraw_DrawPreference);
286 }
287
288 if (!this->onGetWritePixelsInfo(dstSurface, width, height, rowBytes, srcConfig, drawPreference,
289 tempDrawInfo)) {
290 return false;
291 }
292
293 // Check to see if we're going to request that the caller draw when drawing is not possible.
294 if (!dstSurface->asRenderTarget() ||
295 !this->caps()->isConfigTexturable(tempDrawInfo->fTempSurfaceDesc.fConfig)) {
296 // If we don't have a fallback to a straight upload then fail.
297 if (kRequireDraw_DrawPreference == *drawPreference ||
298 !this->caps()->isConfigTexturable(srcConfig)) {
299 return false;
300 }
301 *drawPreference = kNoDraw_DrawPreference;
302 }
303 return true;
304}
305
bsalomon6cb3cbe2015-07-30 07:34:27 -0700306bool GrGpu::readPixels(GrSurface* surface,
bsalomon@google.com669fdc42011-04-05 17:08:27 +0000307 int left, int top, int width, int height,
bsalomon@google.comc6980972011-11-02 19:57:21 +0000308 GrPixelConfig config, void* buffer,
senorblanco@chromium.org3cb406b2013-02-05 19:50:46 +0000309 size_t rowBytes) {
bsalomon@google.coma7f84e12011-03-10 14:13:19 +0000310 this->handleDirtyContext();
egdaniel6d901da2015-07-30 12:02:15 -0700311
312 // We cannot read pixels into a compressed buffer
313 if (GrPixelConfigIsCompressed(config)) {
314 return false;
315 }
316
317 size_t bpp = GrBytesPerPixel(config);
318 if (!GrSurfacePriv::AdjustReadPixelParams(surface->width(), surface->height(), bpp,
319 &left, &top, &width, &height,
320 &buffer,
321 &rowBytes)) {
322 return false;
323 }
324
325 return this->onReadPixels(surface,
326 left, top, width, height,
327 config, buffer,
328 rowBytes);
bsalomon@google.coma7f84e12011-03-10 14:13:19 +0000329}
330
bsalomon6cb3cbe2015-07-30 07:34:27 -0700331bool GrGpu::writePixels(GrSurface* surface,
332 int left, int top, int width, int height,
333 GrPixelConfig config, const void* buffer,
334 size_t rowBytes) {
bsalomon@google.com6f379512011-11-16 20:36:03 +0000335 this->handleDirtyContext();
bsalomon6cb3cbe2015-07-30 07:34:27 -0700336 if (this->onWritePixels(surface, left, top, width, height, config, buffer, rowBytes)) {
bsalomonb12ea412015-02-02 21:19:50 -0800337 fStats.incTextureUploads();
338 return true;
339 }
340 return false;
bsalomon@google.com6f379512011-11-16 20:36:03 +0000341}
342
bsalomon@google.com75f9f252012-01-31 13:35:56 +0000343void GrGpu::resolveRenderTarget(GrRenderTarget* target) {
tfarina@chromium.orgf6de4752013-08-17 00:02:59 +0000344 SkASSERT(target);
bsalomon@google.com75f9f252012-01-31 13:35:56 +0000345 this->handleDirtyContext();
346 this->onResolveRenderTarget(target);
347}
348
joshualitt3322fa42014-11-07 08:48:51 -0800349typedef GrTraceMarkerSet::Iter TMIter;
350void GrGpu::saveActiveTraceMarkers() {
351 if (this->caps()->gpuTracingSupport()) {
352 SkASSERT(0 == fStoredTraceMarkers.count());
353 fStoredTraceMarkers.addSet(fActiveTraceMarkers);
354 for (TMIter iter = fStoredTraceMarkers.begin(); iter != fStoredTraceMarkers.end(); ++iter) {
355 this->removeGpuTraceMarker(&(*iter));
356 }
357 }
358}
359
360void GrGpu::restoreActiveTraceMarkers() {
361 if (this->caps()->gpuTracingSupport()) {
362 SkASSERT(0 == fActiveTraceMarkers.count());
363 for (TMIter iter = fStoredTraceMarkers.begin(); iter != fStoredTraceMarkers.end(); ++iter) {
364 this->addGpuTraceMarker(&(*iter));
365 }
366 for (TMIter iter = fActiveTraceMarkers.begin(); iter != fActiveTraceMarkers.end(); ++iter) {
367 this->fStoredTraceMarkers.remove(*iter);
368 }
369 }
370}
371
372void GrGpu::addGpuTraceMarker(const GrGpuTraceMarker* marker) {
373 if (this->caps()->gpuTracingSupport()) {
374 SkASSERT(fGpuTraceMarkerCount >= 0);
375 this->fActiveTraceMarkers.add(*marker);
376 this->didAddGpuTraceMarker();
377 ++fGpuTraceMarkerCount;
378 }
379}
380
381void GrGpu::removeGpuTraceMarker(const GrGpuTraceMarker* marker) {
382 if (this->caps()->gpuTracingSupport()) {
383 SkASSERT(fGpuTraceMarkerCount >= 1);
384 this->fActiveTraceMarkers.remove(*marker);
385 this->didRemoveGpuTraceMarker();
386 --fGpuTraceMarkerCount;
387 }
388}
389
bsalomon@google.coma7f84e12011-03-10 14:13:19 +0000390////////////////////////////////////////////////////////////////////////////////
391
bsalomoncb8979d2015-05-05 09:51:38 -0700392void GrGpu::draw(const DrawArgs& args, const GrVertices& vertices) {
bsalomon@google.coma7f84e12011-03-10 14:13:19 +0000393 this->handleDirtyContext();
bsalomoncb02b382015-08-12 11:14:50 -0700394 if (GrXferBarrierType barrierType = args.fPipeline->xferBarrierType(*this->caps())) {
395 this->xferBarrier(args.fPipeline->getRenderTarget(), barrierType);
396 }
397
bsalomone64eb572015-05-07 11:35:55 -0700398 GrVertices::Iterator iter;
399 const GrNonInstancedVertices* verts = iter.init(vertices);
400 do {
401 this->onDraw(args, *verts);
402 } while ((verts = iter.next()));
bsalomon@google.com1c13c962011-02-14 16:51:21 +0000403}