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

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

Issue 1486923004: Retract GrRenderTarget a bit (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years 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/SkGpuDevice_drawTexture.cpp ('k') | src/gpu/batches/GrTessellatingPathRenderer.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 2011 Google Inc. 2 * Copyright 2011 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 "GrAAHairLinePathRenderer.h" 8 #include "GrAAHairLinePathRenderer.h"
9 9
10 #include "GrBatchFlushState.h" 10 #include "GrBatchFlushState.h"
(...skipping 957 matching lines...) Expand 10 before | Expand all | Expand 10 after
968 geometry.fCoverage = newCoverage; 968 geometry.fCoverage = newCoverage;
969 geometry.fViewMatrix = viewMatrix; 969 geometry.fViewMatrix = viewMatrix;
970 geometry.fPath = path; 970 geometry.fPath = path;
971 geometry.fDevClipBounds = devClipBounds; 971 geometry.fDevClipBounds = devClipBounds;
972 972
973 return AAHairlineBatch::Create(geometry); 973 return AAHairlineBatch::Create(geometry);
974 } 974 }
975 975
976 bool GrAAHairLinePathRenderer::onDrawPath(const DrawPathArgs& args) { 976 bool GrAAHairLinePathRenderer::onDrawPath(const DrawPathArgs& args) {
977 SkIRect devClipBounds; 977 SkIRect devClipBounds;
978 args.fPipelineBuilder->clip().getConservativeBounds(args.fPipelineBuilder->g etRenderTarget(), 978 GrRenderTarget* rt = args.fPipelineBuilder->getRenderTarget();
979 &devClipBounds); 979 args.fPipelineBuilder->clip().getConservativeBounds(rt->width(), rt->height( ), &devClipBounds);
980 980
981 SkAutoTUnref<GrDrawBatch> batch(create_hairline_batch(args.fColor, *args.fVi ewMatrix, *args.fPath, 981 SkAutoTUnref<GrDrawBatch> batch(create_hairline_batch(args.fColor, *args.fVi ewMatrix, *args.fPath,
982 *args.fStroke, devClip Bounds)); 982 *args.fStroke, devClip Bounds));
983 args.fTarget->drawBatch(*args.fPipelineBuilder, batch); 983 args.fTarget->drawBatch(*args.fPipelineBuilder, batch);
984 984
985 return true; 985 return true;
986 } 986 }
987 987
988 //////////////////////////////////////////////////////////////////////////////// /////////////////// 988 //////////////////////////////////////////////////////////////////////////////// ///////////////////
989 989
990 #ifdef GR_TEST_UTILS 990 #ifdef GR_TEST_UTILS
991 991
992 DRAW_BATCH_TEST_DEFINE(AAHairlineBatch) { 992 DRAW_BATCH_TEST_DEFINE(AAHairlineBatch) {
993 GrColor color = GrRandomColor(random); 993 GrColor color = GrRandomColor(random);
994 SkMatrix viewMatrix = GrTest::TestMatrix(random); 994 SkMatrix viewMatrix = GrTest::TestMatrix(random);
995 GrStrokeInfo stroke(SkStrokeRec::kHairline_InitStyle); 995 GrStrokeInfo stroke(SkStrokeRec::kHairline_InitStyle);
996 SkPath path = GrTest::TestPath(random); 996 SkPath path = GrTest::TestPath(random);
997 SkIRect devClipBounds; 997 SkIRect devClipBounds;
998 devClipBounds.setEmpty(); 998 devClipBounds.setEmpty();
999 return create_hairline_batch(color, viewMatrix, path, stroke, devClipBounds) ; 999 return create_hairline_batch(color, viewMatrix, path, stroke, devClipBounds) ;
1000 } 1000 }
1001 1001
1002 #endif 1002 #endif
OLDNEW
« no previous file with comments | « src/gpu/SkGpuDevice_drawTexture.cpp ('k') | src/gpu/batches/GrTessellatingPathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698