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

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

Issue 1306803003: Revert of Remove GrStagedProcessor, remove the word Stage as it applies to FPs (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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/GrContext.cpp ('k') | src/gpu/GrPaint.cpp » ('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 2013 Google Inc. 2 * Copyright 2013 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 "GrOvalRenderer.h" 8 #include "GrOvalRenderer.h"
9 9
10 #include "GrBatchFlushState.h" 10 #include "GrBatchFlushState.h"
(...skipping 1405 matching lines...) Expand 10 before | Expand all | Expand 10 after
1416 } 1416 }
1417 GrPrimitiveEdgeType edgeType = applyAA ? 1417 GrPrimitiveEdgeType edgeType = applyAA ?
1418 kInverseFillAA_GrProcessorEdgeType : 1418 kInverseFillAA_GrProcessorEdgeType :
1419 kInverseFillBW_GrProcessorEdgeType; 1419 kInverseFillBW_GrProcessorEdgeType;
1420 // TODO this needs to be a geometry processor 1420 // TODO this needs to be a geometry processor
1421 GrFragmentProcessor* fp = GrRRectEffect::Create(edgeType, *inner); 1421 GrFragmentProcessor* fp = GrRRectEffect::Create(edgeType, *inner);
1422 if (NULL == fp) { 1422 if (NULL == fp) {
1423 return false; 1423 return false;
1424 } 1424 }
1425 arfps.set(&pipelineBuilder); 1425 arfps.set(&pipelineBuilder);
1426 arfps.addCoverageFragmentProcessor(fp)->unref(); 1426 arfps.addCoverageProcessor(fp)->unref();
1427 } 1427 }
1428 1428
1429 SkStrokeRec fillRec(SkStrokeRec::kFill_InitStyle); 1429 SkStrokeRec fillRec(SkStrokeRec::kFill_InitStyle);
1430 if (DrawRRect(target, pipelineBuilder, color, viewMatrix, useAA, origOuter, fillRec)) { 1430 if (DrawRRect(target, pipelineBuilder, color, viewMatrix, useAA, origOuter, fillRec)) {
1431 return true; 1431 return true;
1432 } 1432 }
1433 1433
1434 SkASSERT(!origOuter.isEmpty()); 1434 SkASSERT(!origOuter.isEmpty());
1435 SkTCopyOnFirstWrite<SkRRect> outer(origOuter); 1435 SkTCopyOnFirstWrite<SkRRect> outer(origOuter);
1436 if (!viewMatrix.isIdentity()) { 1436 if (!viewMatrix.isIdentity()) {
1437 if (!origOuter.transform(viewMatrix, outer.writable())) { 1437 if (!origOuter.transform(viewMatrix, outer.writable())) {
1438 return false; 1438 return false;
1439 } 1439 }
1440 } 1440 }
1441 GrPrimitiveEdgeType edgeType = applyAA ? kFillAA_GrProcessorEdgeType : 1441 GrPrimitiveEdgeType edgeType = applyAA ? kFillAA_GrProcessorEdgeType :
1442 kFillBW_GrProcessorEdgeType; 1442 kFillBW_GrProcessorEdgeType;
1443 GrFragmentProcessor* effect = GrRRectEffect::Create(edgeType, *outer); 1443 GrFragmentProcessor* effect = GrRRectEffect::Create(edgeType, *outer);
1444 if (NULL == effect) { 1444 if (NULL == effect) {
1445 return false; 1445 return false;
1446 } 1446 }
1447 if (!arfps.isSet()) { 1447 if (!arfps.isSet()) {
1448 arfps.set(&pipelineBuilder); 1448 arfps.set(&pipelineBuilder);
1449 } 1449 }
1450 1450
1451 SkMatrix invert; 1451 SkMatrix invert;
1452 if (!viewMatrix.invert(&invert)) { 1452 if (!viewMatrix.invert(&invert)) {
1453 return false; 1453 return false;
1454 } 1454 }
1455 1455
1456 arfps.addCoverageFragmentProcessor(effect)->unref(); 1456 arfps.addCoverageProcessor(effect)->unref();
1457 SkRect bounds = outer->getBounds(); 1457 SkRect bounds = outer->getBounds();
1458 if (applyAA) { 1458 if (applyAA) {
1459 bounds.outset(SK_ScalarHalf, SK_ScalarHalf); 1459 bounds.outset(SK_ScalarHalf, SK_ScalarHalf);
1460 } 1460 }
1461 target->drawNonAARect(pipelineBuilder, color, SkMatrix::I(), bounds, invert) ; 1461 target->drawNonAARect(pipelineBuilder, color, SkMatrix::I(), bounds, invert) ;
1462 return true; 1462 return true;
1463 } 1463 }
1464 1464
1465 //////////////////////////////////////////////////////////////////////////////// /////////////////// 1465 //////////////////////////////////////////////////////////////////////////////// ///////////////////
1466 1466
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after
2037 } 2037 }
2038 2038
2039 DRAW_BATCH_TEST_DEFINE(RRectBatch) { 2039 DRAW_BATCH_TEST_DEFINE(RRectBatch) {
2040 SkMatrix viewMatrix = GrTest::TestMatrixRectStaysRect(random); 2040 SkMatrix viewMatrix = GrTest::TestMatrixRectStaysRect(random);
2041 GrColor color = GrRandomColor(random); 2041 GrColor color = GrRandomColor(random);
2042 const SkRRect& rrect = GrTest::TestRRectSimple(random); 2042 const SkRRect& rrect = GrTest::TestRRectSimple(random);
2043 return create_rrect_batch(color, viewMatrix, rrect, GrTest::TestStrokeRec(ra ndom)); 2043 return create_rrect_batch(color, viewMatrix, rrect, GrTest::TestStrokeRec(ra ndom));
2044 } 2044 }
2045 2045
2046 #endif 2046 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | src/gpu/GrPaint.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698