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

Side by Side Diff: src/gpu/batches/GrTessellatingPathRenderer.cpp

Issue 1966903004: Remove clip from GrPipelineBuilder (Closed) Base URL: https://skia.googlesource.com/skia.git@fix2_nvpr
Patch Set: Created 4 years, 7 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
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 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 "GrTessellatingPathRenderer.h" 8 #include "GrTessellatingPathRenderer.h"
9 9
10 #include "GrBatchFlushState.h" 10 #include "GrBatchFlushState.h"
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 bool GrTessellatingPathRenderer::onDrawPath(const DrawPathArgs& args) { 280 bool GrTessellatingPathRenderer::onDrawPath(const DrawPathArgs& args) {
281 GR_AUDIT_TRAIL_AUTO_FRAME(args.fTarget->getAuditTrail(), 281 GR_AUDIT_TRAIL_AUTO_FRAME(args.fTarget->getAuditTrail(),
282 "GrTessellatingPathRenderer::onDrawPath"); 282 "GrTessellatingPathRenderer::onDrawPath");
283 SkASSERT(!args.fAntiAlias); 283 SkASSERT(!args.fAntiAlias);
284 const GrRenderTarget* rt = args.fPipelineBuilder->getRenderTarget(); 284 const GrRenderTarget* rt = args.fPipelineBuilder->getRenderTarget();
285 if (nullptr == rt) { 285 if (nullptr == rt) {
286 return false; 286 return false;
287 } 287 }
288 288
289 SkIRect clipBoundsI; 289 SkIRect clipBoundsI;
290 args.fPipelineBuilder->clip().getConservativeBounds(rt->width(), rt->height( ), &clipBoundsI); 290 args.fClip->getConservativeBounds(rt->width(), rt->height(), &clipBoundsI);
291 SkRect clipBounds = SkRect::Make(clipBoundsI); 291 SkRect clipBounds = SkRect::Make(clipBoundsI);
292 SkMatrix vmi; 292 SkMatrix vmi;
293 if (!args.fViewMatrix->invert(&vmi)) { 293 if (!args.fViewMatrix->invert(&vmi)) {
294 return false; 294 return false;
295 } 295 }
296 vmi.mapRect(&clipBounds); 296 vmi.mapRect(&clipBounds);
297 SkAutoTUnref<GrDrawBatch> batch(TessellatingPathBatch::Create(args.fColor, * args.fPath, 297 SkAutoTUnref<GrDrawBatch> batch(TessellatingPathBatch::Create(args.fColor, * args.fPath,
298 *args.fStyle, *args.fViewMatrix, 298 *args.fStyle, *args.fViewMatrix,
299 clipBounds)); 299 clipBounds));
300 args.fTarget->drawBatch(*args.fPipelineBuilder, batch); 300 args.fTarget->drawBatch(*args.fPipelineBuilder, *args.fClip, batch);
301 301
302 return true; 302 return true;
303 } 303 }
304 304
305 //////////////////////////////////////////////////////////////////////////////// /////////////////// 305 //////////////////////////////////////////////////////////////////////////////// ///////////////////
306 306
307 #ifdef GR_TEST_UTILS 307 #ifdef GR_TEST_UTILS
308 308
309 DRAW_BATCH_TEST_DEFINE(TesselatingPathBatch) { 309 DRAW_BATCH_TEST_DEFINE(TesselatingPathBatch) {
310 GrColor color = GrRandomColor(random); 310 GrColor color = GrRandomColor(random);
311 SkMatrix viewMatrix = GrTest::TestMatrixInvertible(random); 311 SkMatrix viewMatrix = GrTest::TestMatrixInvertible(random);
312 SkPath path = GrTest::TestPath(random); 312 SkPath path = GrTest::TestPath(random);
313 SkRect clipBounds = GrTest::TestRect(random); 313 SkRect clipBounds = GrTest::TestRect(random);
314 SkMatrix vmi; 314 SkMatrix vmi;
315 bool result = viewMatrix.invert(&vmi); 315 bool result = viewMatrix.invert(&vmi);
316 if (!result) { 316 if (!result) {
317 SkFAIL("Cannot invert matrix\n"); 317 SkFAIL("Cannot invert matrix\n");
318 } 318 }
319 vmi.mapRect(&clipBounds); 319 vmi.mapRect(&clipBounds);
320 GrStyle style; 320 GrStyle style;
321 do { 321 do {
322 GrTest::TestStyle(random, &style); 322 GrTest::TestStyle(random, &style);
323 } while (style.strokeRec().isHairlineStyle()); 323 } while (style.strokeRec().isHairlineStyle());
324 return TessellatingPathBatch::Create(color, path, style, viewMatrix, clipBou nds); 324 return TessellatingPathBatch::Create(color, path, style, viewMatrix, clipBou nds);
325 } 325 }
326 326
327 #endif 327 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698