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

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

Issue 209413006: Make it possible to draw multiple paths at once to a draw target (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: address review comment Created 6 years, 9 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/GrDrawTarget.h ('k') | src/gpu/GrGpu.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 /* 2 /*
3 * Copyright 2010 Google Inc. 3 * Copyright 2010 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 10
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 viewM.mapRect(&devBounds); 541 viewM.mapRect(&devBounds);
542 542
543 GrDeviceCoordTexture dstCopy; 543 GrDeviceCoordTexture dstCopy;
544 if (!this->setupDstReadIfNecessary(&dstCopy, &devBounds)) { 544 if (!this->setupDstReadIfNecessary(&dstCopy, &devBounds)) {
545 return; 545 return;
546 } 546 }
547 547
548 this->onDrawPath(path, fill, dstCopy.texture() ? &dstCopy : NULL); 548 this->onDrawPath(path, fill, dstCopy.texture() ? &dstCopy : NULL);
549 } 549 }
550 550
551 void GrDrawTarget::drawPaths(size_t pathCount, const GrPath** paths,
552 const SkMatrix* transforms,
553 SkPath::FillType fill, SkStrokeRec::Style stroke) {
554 SkASSERT(pathCount > 0);
555 SkASSERT(NULL != paths);
556 SkASSERT(NULL != paths[0]);
557 SkASSERT(this->caps()->pathRenderingSupport());
558 SkASSERT(!SkPath::IsInverseFillType(fill));
559
560 const GrDrawState* drawState = &getDrawState();
561
562 SkRect devBounds;
563 for (size_t i = 0; i < pathCount; ++i) {
564 SkRect mappedPathBounds;
565 transforms[i].mapRect(&mappedPathBounds, paths[i]->getBounds());
566 devBounds.join(mappedPathBounds);
567 }
568
569 SkMatrix viewM = drawState->getViewMatrix();
570 viewM.mapRect(&devBounds);
571
572 GrDeviceCoordTexture dstCopy;
573 if (!this->setupDstReadIfNecessary(&dstCopy, &devBounds)) {
574 return;
575 }
576
577 this->onDrawPaths(pathCount, paths, transforms, fill, stroke,
578 dstCopy.texture() ? &dstCopy : NULL);
579 }
580
551 void GrDrawTarget::instantGpuTraceEvent(const char* marker) { 581 void GrDrawTarget::instantGpuTraceEvent(const char* marker) {
552 if (this->caps()->gpuTracingSupport()) { 582 if (this->caps()->gpuTracingSupport()) {
553 this->onInstantGpuTraceEvent(marker); 583 this->onInstantGpuTraceEvent(marker);
554 } 584 }
555 } 585 }
556 586
557 void GrDrawTarget::pushGpuTraceEvent(const char* marker) { 587 void GrDrawTarget::pushGpuTraceEvent(const char* marker) {
558 SkASSERT(fPushGpuTraceCount >= 0); 588 SkASSERT(fPushGpuTraceCount >= 0);
559 if (this->caps()->gpuTracingSupport()) { 589 if (this->caps()->gpuTracingSupport()) {
560 this->onPushGpuTraceEvent(marker); 590 this->onPushGpuTraceEvent(marker);
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after
1072 for (size_t i = 0; i < SK_ARRAY_COUNT(kConfigNames); ++i) { 1102 for (size_t i = 0; i < SK_ARRAY_COUNT(kConfigNames); ++i) {
1073 if (i != kUnknown_GrPixelConfig) { 1103 if (i != kUnknown_GrPixelConfig) {
1074 r.appendf("%s is renderable: %s, with MSAA: %s\n", 1104 r.appendf("%s is renderable: %s, with MSAA: %s\n",
1075 kConfigNames[i], 1105 kConfigNames[i],
1076 gNY[fConfigRenderSupport[i][0]], 1106 gNY[fConfigRenderSupport[i][0]],
1077 gNY[fConfigRenderSupport[i][1]]); 1107 gNY[fConfigRenderSupport[i][1]]);
1078 } 1108 }
1079 } 1109 }
1080 return r; 1110 return r;
1081 } 1111 }
OLDNEW
« no previous file with comments | « src/gpu/GrDrawTarget.h ('k') | src/gpu/GrGpu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698