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

Unified Diff: src/gpu/GrDrawContext.cpp

Issue 2182783004: Add test configs for instanced rendering (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add test configs for instanced rendering Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrCaps.cpp ('k') | src/gpu/GrDrawTarget.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDrawContext.cpp
diff --git a/src/gpu/GrDrawContext.cpp b/src/gpu/GrDrawContext.cpp
index fedb397200ff20d30f9a5cdefc4720724a60a61a..195cb7a91176c0d28986bd1f9195663d3a5b9b86 100644
--- a/src/gpu/GrDrawContext.cpp
+++ b/src/gpu/GrDrawContext.cpp
@@ -368,7 +368,8 @@ bool GrDrawContext::drawFilledRect(const GrClip& clip,
SkAutoTUnref<GrDrawBatch> batch;
bool useHWAA;
- if (InstancedRendering* ir = this->getDrawTarget()->instancedRendering()) {
+ if (GrCaps::InstancedSupport::kNone != fContext->caps()->instancedSupport()) {
+ InstancedRendering* ir = this->getDrawTarget()->instancedRendering();
batch.reset(ir->recordRect(croppedRect, viewMatrix, paint.getColor(),
paint.isAntiAlias(), fInstancedPipelineInfo,
&useHWAA));
@@ -618,7 +619,8 @@ void GrDrawContext::fillRectToRect(const GrClip& clip,
AutoCheckFlush acf(fDrawingManager);
bool useHWAA;
- if (InstancedRendering* ir = this->getDrawTarget()->instancedRendering()) {
+ if (GrCaps::InstancedSupport::kNone != fContext->caps()->instancedSupport()) {
+ InstancedRendering* ir = this->getDrawTarget()->instancedRendering();
SkAutoTUnref<GrDrawBatch> batch(ir->recordRect(croppedRect, viewMatrix, paint.getColor(),
croppedLocalRect, paint.isAntiAlias(),
fInstancedPipelineInfo, &useHWAA));
@@ -676,7 +678,8 @@ void GrDrawContext::fillRectWithLocalMatrix(const GrClip& clip,
AutoCheckFlush acf(fDrawingManager);
bool useHWAA;
- if (InstancedRendering* ir = this->getDrawTarget()->instancedRendering()) {
+ if (GrCaps::InstancedSupport::kNone != fContext->caps()->instancedSupport()) {
+ InstancedRendering* ir = this->getDrawTarget()->instancedRendering();
SkAutoTUnref<GrDrawBatch> batch(ir->recordRect(croppedRect, viewMatrix, paint.getColor(),
localMatrix, paint.isAntiAlias(),
fInstancedPipelineInfo, &useHWAA));
@@ -803,7 +806,8 @@ void GrDrawContext::drawRRect(const GrClip& clip,
const SkStrokeRec stroke = style.strokeRec();
bool useHWAA;
- if (this->getDrawTarget()->instancedRendering() && stroke.isFillStyle()) {
+ if (GrCaps::InstancedSupport::kNone != fContext->caps()->instancedSupport() &&
+ stroke.isFillStyle()) {
InstancedRendering* ir = this->getDrawTarget()->instancedRendering();
SkAutoTUnref<GrDrawBatch> batch(ir->recordRRect(rrect, viewMatrix, paint.getColor(),
paint.isAntiAlias(), fInstancedPipelineInfo,
@@ -843,8 +847,9 @@ bool GrDrawContext::drawFilledDRRect(const GrClip& clip,
SkASSERT(!origInner.isEmpty());
SkASSERT(!origOuter.isEmpty());
- if (InstancedRendering* ir = this->getDrawTarget()->instancedRendering()) {
+ if (GrCaps::InstancedSupport::kNone != fContext->caps()->instancedSupport()) {
bool useHWAA;
+ InstancedRendering* ir = this->getDrawTarget()->instancedRendering();
SkAutoTUnref<GrDrawBatch> batch(ir->recordDRRect(origOuter, origInner, viewMatrix,
paintIn.getColor(), paintIn.isAntiAlias(),
fInstancedPipelineInfo, &useHWAA));
@@ -954,7 +959,8 @@ void GrDrawContext::drawOval(const GrClip& clip,
const SkStrokeRec& stroke = style.strokeRec();
bool useHWAA;
- if (this->getDrawTarget()->instancedRendering() && stroke.isFillStyle()) {
+ if (GrCaps::InstancedSupport::kNone != fContext->caps()->instancedSupport() &&
+ stroke.isFillStyle()) {
InstancedRendering* ir = this->getDrawTarget()->instancedRendering();
SkAutoTUnref<GrDrawBatch> batch(ir->recordOval(oval, viewMatrix, paint.getColor(),
paint.isAntiAlias(), fInstancedPipelineInfo,
« no previous file with comments | « src/gpu/GrCaps.cpp ('k') | src/gpu/GrDrawTarget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698