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

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

Issue 2437063002: re-re-land of skslc now automatically turns on derivatives support (Closed)
Patch Set: Created 4 years, 2 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 | « fuzz/fuzz.cpp ('k') | src/gpu/batches/GrAAConvexPathRenderer.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 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 &fViewMatrixUniform); 456 &fViewMatrixUniform);
457 457
458 // emit transforms 458 // emit transforms
459 this->emitTransforms(vertBuilder, 459 this->emitTransforms(vertBuilder,
460 varyingHandler, 460 varyingHandler,
461 uniformHandler, 461 uniformHandler,
462 gpArgs->fPositionVar, 462 gpArgs->fPositionVar,
463 diegp.fInPosition->fName, 463 diegp.fInPosition->fName,
464 args.fFPCoordTransformHandler); 464 args.fFPCoordTransformHandler);
465 465
466 SkAssertResult(fragBuilder->enableFeature(
467 GrGLSLFragmentShaderBuilder::kStandardDerivatives_GLSLFeatur e));
468 // for outer curve 466 // for outer curve
469 fragBuilder->codeAppendf("vec2 scaledOffset = %s.xy;", offsets0.fsIn ()); 467 fragBuilder->codeAppendf("vec2 scaledOffset = %s.xy;", offsets0.fsIn ());
470 fragBuilder->codeAppend("float test = dot(scaledOffset, scaledOffset ) - 1.0;"); 468 fragBuilder->codeAppend("float test = dot(scaledOffset, scaledOffset ) - 1.0;");
471 fragBuilder->codeAppendf("vec2 duvdx = dFdx(%s);", offsets0.fsIn()); 469 fragBuilder->codeAppendf("vec2 duvdx = dFdx(%s);", offsets0.fsIn());
472 fragBuilder->codeAppendf("vec2 duvdy = dFdy(%s);", offsets0.fsIn()); 470 fragBuilder->codeAppendf("vec2 duvdy = dFdy(%s);", offsets0.fsIn());
473 fragBuilder->codeAppendf("vec2 grad = vec2(2.0*%s.x*duvdx.x + 2.0*%s .y*duvdx.y," 471 fragBuilder->codeAppendf("vec2 grad = vec2(2.0*%s.x*duvdx.x + 2.0*%s .y*duvdx.y,"
474 " 2.0*%s.x*duvdy.x + 2.0*%s .y*duvdy.y);", 472 " 2.0*%s.x*duvdy.x + 2.0*%s .y*duvdy.y);",
475 offsets0.fsIn(), offsets0.fsIn(), offsets0. fsIn(), 473 offsets0.fsIn(), offsets0.fsIn(), offsets0. fsIn(),
476 offsets0.fsIn()); 474 offsets0.fsIn());
477 475
(...skipping 1970 matching lines...) Expand 10 before | Expand all | Expand 10 after
2448 DRAW_BATCH_TEST_DEFINE(RRectBatch) { 2446 DRAW_BATCH_TEST_DEFINE(RRectBatch) {
2449 SkMatrix viewMatrix = GrTest::TestMatrixRectStaysRect(random); 2447 SkMatrix viewMatrix = GrTest::TestMatrixRectStaysRect(random);
2450 GrColor color = GrRandomColor(random); 2448 GrColor color = GrRandomColor(random);
2451 const SkRRect& rrect = GrTest::TestRRectSimple(random); 2449 const SkRRect& rrect = GrTest::TestRRectSimple(random);
2452 bool needsDistance = random->nextBool(); 2450 bool needsDistance = random->nextBool();
2453 return create_rrect_batch(color, needsDistance, viewMatrix, rrect, 2451 return create_rrect_batch(color, needsDistance, viewMatrix, rrect,
2454 GrTest::TestStrokeRec(random)); 2452 GrTest::TestStrokeRec(random));
2455 } 2453 }
2456 2454
2457 #endif 2455 #endif
OLDNEW
« no previous file with comments | « fuzz/fuzz.cpp ('k') | src/gpu/batches/GrAAConvexPathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698