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

Unified Diff: src/gpu/GrDrawContext.cpp

Issue 2123693002: Revert of Begin instanced rendering for simple shapes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 | « include/private/GrInstancedPipelineInfo.h ('k') | src/gpu/GrDrawContextPriv.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 dc24fb54390a82fb7eba556aa046c3a4020e0ab2..d057984f9c67b61e399cfc967437091aad4230f7 100644
--- a/src/gpu/GrDrawContext.cpp
+++ b/src/gpu/GrDrawContext.cpp
@@ -25,8 +25,6 @@
#include "effects/GrRRectEffect.h"
-#include "instanced/InstancedRendering.h"
-
#include "text/GrAtlasTextContext.h"
#include "text/GrStencilAndCoverTextContext.h"
@@ -42,8 +40,6 @@
#define RETURN_FALSE_IF_ABANDONED if (fDrawingManager->wasAbandoned()) { return false; }
#define RETURN_FALSE_IF_ABANDONED_PRIV if (fDrawContext->fDrawingManager->wasAbandoned()) { return false; }
#define RETURN_NULL_IF_ABANDONED if (fDrawingManager->wasAbandoned()) { return nullptr; }
-
-using gr_instanced::InstancedRendering;
class AutoCheckFlush {
public:
@@ -74,7 +70,6 @@
, fRenderTarget(std::move(rt))
, fDrawTarget(SkSafeRef(fRenderTarget->getLastDrawTarget()))
, fContext(context)
- , fInstancedPipelineInfo(fRenderTarget.get())
, fSurfaceProps(SkSurfacePropsCopyOrDefault(surfaceProps))
, fAuditTrail(auditTrail)
#ifdef SK_DEBUG
@@ -278,29 +273,23 @@
const SkMatrix& viewMatrix,
const SkRect& rect,
bool* useHWAA) {
- if (InstancedRendering* ir = this->getDrawTarget()->instancedRendering()) {
- if (GrDrawBatch* batch = ir->recordRect(rect, viewMatrix, paint.getColor(),
- paint.isAntiAlias(), fInstancedPipelineInfo,
- useHWAA)) {
- return batch;
- }
- }
-
+
+ GrDrawBatch* batch = nullptr;
if (should_apply_coverage_aa(paint, fRenderTarget.get(), useHWAA)) {
// The fill path can handle rotation but not skew.
if (view_matrix_ok_for_aa_fill_rect(viewMatrix)) {
SkRect devBoundRect;
viewMatrix.mapRect(&devBoundRect, rect);
- return GrRectBatchFactory::CreateAAFill(paint.getColor(), viewMatrix,
- rect, devBoundRect);
+ batch = GrRectBatchFactory::CreateAAFill(paint.getColor(), viewMatrix,
+ rect, devBoundRect);
}
} else {
// filled BW rect
- return GrRectBatchFactory::CreateNonAAFill(paint.getColor(), viewMatrix, rect,
- nullptr, nullptr);
- }
-
- return nullptr;
+ batch = GrRectBatchFactory::CreateNonAAFill(paint.getColor(), viewMatrix, rect,
+ nullptr, nullptr);
+ }
+
+ return batch;
}
void GrDrawContext::drawRect(const GrClip& clip,
@@ -490,19 +479,9 @@
GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::fillRectToRect");
AutoCheckFlush acf(fDrawingManager);
+
+ bool useHWAA;
SkAutoTUnref<GrDrawBatch> batch;
- bool useHWAA;
-
- if (InstancedRendering* ir = this->getDrawTarget()->instancedRendering()) {
- batch.reset(ir->recordRect(rectToDraw, viewMatrix, paint.getColor(), localRect,
- paint.isAntiAlias(), fInstancedPipelineInfo, &useHWAA));
- if (batch) {
- GrPipelineBuilder pipelineBuilder(paint, useHWAA);
- this->getDrawTarget()->drawBatch(pipelineBuilder, this, clip, batch);
- return;
- }
- }
-
if (should_apply_coverage_aa(paint, fRenderTarget.get(), &useHWAA) &&
view_matrix_ok_for_aa_fill_rect(viewMatrix)) {
batch.reset(GrAAFillRectBatch::CreateWithLocalRect(paint.getColor(), viewMatrix, rectToDraw,
@@ -529,19 +508,9 @@
GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::fillRectWithLocalMatrix");
AutoCheckFlush acf(fDrawingManager);
+
+ bool useHWAA;
SkAutoTUnref<GrDrawBatch> batch;
- bool useHWAA;
-
- if (InstancedRendering* ir = this->getDrawTarget()->instancedRendering()) {
- batch.reset(ir->recordRect(rectToDraw, viewMatrix, paint.getColor(), localMatrix,
- paint.isAntiAlias(), fInstancedPipelineInfo, &useHWAA));
- if (batch) {
- GrPipelineBuilder pipelineBuilder(paint, useHWAA);
- this->getDrawTarget()->drawBatch(pipelineBuilder, this, clip, batch);
- return;
- }
- }
-
if (should_apply_coverage_aa(paint, fRenderTarget.get(), &useHWAA) &&
view_matrix_ok_for_aa_fill_rect(viewMatrix)) {
batch.reset(GrAAFillRectBatch::Create(paint.getColor(), viewMatrix, localMatrix,
@@ -638,25 +607,13 @@
}
SkASSERT(!style.pathEffect()); // this should've been devolved to a path in SkGpuDevice
-
- AutoCheckFlush acf(fDrawingManager);
const SkStrokeRec stroke = style.strokeRec();
+ AutoCheckFlush acf(fDrawingManager);
+
bool useHWAA;
-
- if (this->getDrawTarget()->instancedRendering() && stroke.isFillStyle()) {
- InstancedRendering* ir = this->getDrawTarget()->instancedRendering();
- SkAutoTUnref<GrDrawBatch> batch(ir->recordRRect(rrect, viewMatrix, paint.getColor(),
- paint.isAntiAlias(), fInstancedPipelineInfo,
- &useHWAA));
- if (batch) {
- GrPipelineBuilder pipelineBuilder(paint, useHWAA);
- this->getDrawTarget()->drawBatch(pipelineBuilder, this, clip, batch);
- return;
- }
- }
-
if (should_apply_coverage_aa(paint, fRenderTarget.get(), &useHWAA)) {
GrShaderCaps* shaderCaps = fContext->caps()->shaderCaps();
+
SkAutoTUnref<GrDrawBatch> batch(GrOvalRenderer::CreateRRectBatch(paint.getColor(),
viewMatrix,
rrect,
@@ -683,18 +640,6 @@
SkASSERT(!origInner.isEmpty());
SkASSERT(!origOuter.isEmpty());
- if (InstancedRendering* ir = this->getDrawTarget()->instancedRendering()) {
- bool useHWAA;
- SkAutoTUnref<GrDrawBatch> batch(ir->recordDRRect(origOuter, origInner, viewMatrix,
- paintIn.getColor(), paintIn.isAntiAlias(),
- fInstancedPipelineInfo, &useHWAA));
- if (batch) {
- GrPipelineBuilder pipelineBuilder(paintIn, useHWAA);
- this->getDrawTarget()->drawBatch(pipelineBuilder, this, clip, batch);
- return true;
- }
- }
-
bool applyAA = paintIn.isAntiAlias() && !fRenderTarget->isUnifiedMultisampled();
GrPrimitiveEdgeType innerEdgeType = applyAA ? kInverseFillAA_GrProcessorEdgeType :
@@ -793,19 +738,6 @@
AutoCheckFlush acf(fDrawingManager);
const SkStrokeRec& stroke = style.strokeRec();
bool useHWAA;
-
- if (this->getDrawTarget()->instancedRendering() && stroke.isFillStyle()) {
- InstancedRendering* ir = this->getDrawTarget()->instancedRendering();
- SkAutoTUnref<GrDrawBatch> batch(ir->recordOval(oval, viewMatrix, paint.getColor(),
- paint.isAntiAlias(), fInstancedPipelineInfo,
- &useHWAA));
- if (batch) {
- GrPipelineBuilder pipelineBuilder(paint, useHWAA);
- this->getDrawTarget()->drawBatch(pipelineBuilder, this, clip, batch);
- return;
- }
- }
-
if (should_apply_coverage_aa(paint, fRenderTarget.get(), &useHWAA)) {
GrShaderCaps* shaderCaps = fContext->caps()->shaderCaps();
SkAutoTUnref<GrDrawBatch> batch(GrOvalRenderer::CreateOvalBatch(paint.getColor(),
« no previous file with comments | « include/private/GrInstancedPipelineInfo.h ('k') | src/gpu/GrDrawContextPriv.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698