Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1525)

Side by Side Diff: src/gpu/GrGpuCommandBuffer.cpp

Issue 2262473003: Define clear regions in terms of GrFixedClip (Closed) Base URL: https://skia.googlesource.com/skia.git@upload_fixedcliptosrc
Patch Set: rebase Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/GrGpuCommandBuffer.h ('k') | src/gpu/GrPathRenderer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2016 Google Inc. 2 * Copyright 2016 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "GrGpuCommandBuffer.h" 8 #include "GrGpuCommandBuffer.h"
9 9
10 #include "GrCaps.h" 10 #include "GrCaps.h"
11 #include "GrFixedClip.h"
11 #include "GrGpu.h" 12 #include "GrGpu.h"
12 #include "GrPrimitiveProcessor.h" 13 #include "GrPrimitiveProcessor.h"
13 #include "GrRenderTarget.h" 14 #include "GrRenderTarget.h"
14 #include "SkRect.h" 15 #include "SkRect.h"
15 16
16 void GrGpuCommandBuffer::submit(const SkIRect& bounds) { 17 void GrGpuCommandBuffer::submit(const SkIRect& bounds) {
17 this->gpu()->handleDirtyContext(); 18 this->gpu()->handleDirtyContext();
18 this->onSubmit(bounds); 19 this->onSubmit(bounds);
19 } 20 }
20 21
21 void GrGpuCommandBuffer::clear(const SkIRect& rect, GrColor color, GrRenderTarge t* renderTarget) { 22 void GrGpuCommandBuffer::clear(const GrFixedClip& clip, GrColor color, GrRenderT arget* rt) {
22 SkASSERT(renderTarget); 23 SkASSERT(rt);
23 SkASSERT(SkIRect::MakeWH(renderTarget->width(), renderTarget->height()).cont ains(rect)); 24 SkASSERT(!clip.scissorEnabled() ||
24 this->onClear(renderTarget, rect, color); 25 (SkIRect::MakeWH(rt->width(), rt->height()).contains(clip.scissorRe ct()) &&
26 SkIRect::MakeWH(rt->width(), rt->height()) != clip.scissorRect())) ;
27 this->onClear(rt, clip, color);
25 } 28 }
26 29
27 void GrGpuCommandBuffer::clearStencilClip(const SkIRect& rect, 30 void GrGpuCommandBuffer::clearStencilClip(const GrFixedClip& clip,
28 bool insideClip, 31 bool insideStencilMask,
29 GrRenderTarget* renderTarget) { 32 GrRenderTarget* rt) {
30 SkASSERT(renderTarget); 33 SkASSERT(rt);
31 this->onClearStencilClip(renderTarget, rect, insideClip); 34 this->onClearStencilClip(rt, clip, insideStencilMask);
32 } 35 }
33 36
34 37
35 bool GrGpuCommandBuffer::draw(const GrPipeline& pipeline, 38 bool GrGpuCommandBuffer::draw(const GrPipeline& pipeline,
36 const GrPrimitiveProcessor& primProc, 39 const GrPrimitiveProcessor& primProc,
37 const GrMesh* mesh, 40 const GrMesh* mesh,
38 int meshCount) { 41 int meshCount) {
39 if (primProc.numAttribs() > this->gpu()->caps()->maxVertexAttributes()) { 42 if (primProc.numAttribs() > this->gpu()->caps()->maxVertexAttributes()) {
40 this->gpu()->stats()->incNumFailedDraws(); 43 this->gpu()->stats()->incNumFailedDraws();
41 return false; 44 return false;
42 } 45 }
43 this->onDraw(pipeline, primProc, mesh, meshCount); 46 this->onDraw(pipeline, primProc, mesh, meshCount);
44 return true; 47 return true;
45 } 48 }
46 49
OLDNEW
« no previous file with comments | « src/gpu/GrGpuCommandBuffer.h ('k') | src/gpu/GrPathRenderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698