OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright 2016 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 |
| 8 #include "GrGpuCommandBuffer.h" |
| 9 |
| 10 #include "GrGpu.h" |
| 11 #include "GrPrimitiveProcessor.h" |
| 12 #include "GrRenderTarget.h" |
| 13 #include "SkRect.h" |
| 14 |
| 15 void GrGpuCommandBuffer::submit(const SkIRect& bounds) { |
| 16 this->gpu()->handleDirtyContext(); |
| 17 this->onSubmit(bounds); |
| 18 } |
| 19 |
| 20 void GrGpuCommandBuffer::clear(const SkIRect& rect, GrColor color, GrRenderTarge
t* renderTarget) { |
| 21 SkASSERT(renderTarget); |
| 22 SkASSERT(SkIRect::MakeWH(renderTarget->width(), renderTarget->height()).cont
ains(rect)); |
| 23 this->onClear(renderTarget, rect, color); |
| 24 } |
| 25 |
| 26 void GrGpuCommandBuffer::clearStencilClip(const SkIRect& rect, |
| 27 bool insideClip, |
| 28 GrRenderTarget* renderTarget) { |
| 29 SkASSERT(renderTarget); |
| 30 this->onClearStencilClip(renderTarget, rect, insideClip); |
| 31 } |
| 32 |
| 33 |
| 34 bool GrGpuCommandBuffer::draw(const GrPipeline& pipeline, |
| 35 const GrPrimitiveProcessor& primProc, |
| 36 const GrMesh* mesh, |
| 37 int meshCount) { |
| 38 if (primProc.numAttribs() > this->gpu()->caps()->maxVertexAttributes()) { |
| 39 this->gpu()->stats()->incNumFailedDraws(); |
| 40 return false; |
| 41 } |
| 42 this->onDraw(pipeline, primProc, mesh, meshCount); |
| 43 return true; |
| 44 } |
| 45 |
OLD | NEW |