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

Unified Diff: src/gpu/instanced/InstancedRendering.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/instanced/InstancedRendering.h ('k') | src/gpu/vk/GrVkGpu.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/instanced/InstancedRendering.cpp
diff --git a/src/gpu/instanced/InstancedRendering.cpp b/src/gpu/instanced/InstancedRendering.cpp
index d763b73064db3b44ec54b3464ef76a8034f832e7..66e53dd5dbf87ebcbd5f461c980828ad2c917c09 100644
--- a/src/gpu/instanced/InstancedRendering.cpp
+++ b/src/gpu/instanced/InstancedRendering.cpp
@@ -15,11 +15,8 @@
namespace gr_instanced {
-InstancedRendering::InstancedRendering(GrGpu* gpu, AntialiasMode lastSupportedAAMode,
- bool canRenderToFloat)
+InstancedRendering::InstancedRendering(GrGpu* gpu)
: fGpu(SkRef(gpu)),
- fLastSupportedAAMode(lastSupportedAAMode),
- fCanRenderToFloat(canRenderToFloat),
fState(State::kRecordingDraws),
fDrawPool(1024 * sizeof(Batch::Draw), 1024 * sizeof(Batch::Draw)) {
}
@@ -107,7 +104,7 @@ InstancedRendering::Batch* InstancedRendering::recordShape(ShapeType type, const
bool* useHWAA) {
SkASSERT(State::kRecordingDraws == fState);
- if (info.fIsRenderingToFloat && !fCanRenderToFloat) {
+ if (info.fIsRenderingToFloat && fGpu->caps()->avoidInstancedDrawsToFPTargets()) {
return nullptr;
}
@@ -201,9 +198,9 @@ inline bool InstancedRendering::selectAntialiasMode(const SkMatrix& viewMatrix,
bool* useHWAA, AntialiasMode* antialiasMode) {
SkASSERT(!info.fColorDisabled || info.fDrawingShapeToStencil);
SkASSERT(!info.fIsMixedSampled || info.fIsMultisampled);
+ SkASSERT(GrCaps::InstancedSupport::kNone != fGpu->caps()->instancedSupport());
if (!info.fIsMultisampled || fGpu->caps()->multisampleDisableSupport()) {
- SkASSERT(fLastSupportedAAMode >= AntialiasMode::kCoverage);
if (!antialias) {
if (info.fDrawingShapeToStencil && !info.fCanDiscard) {
// We can't draw to the stencil buffer without discard (or sample mask if MSAA).
@@ -221,13 +218,14 @@ inline bool InstancedRendering::selectAntialiasMode(const SkMatrix& viewMatrix,
}
}
- if (info.fIsMultisampled && fLastSupportedAAMode >= AntialiasMode::kMSAA) {
+ if (info.fIsMultisampled &&
+ fGpu->caps()->instancedSupport() >= GrCaps::InstancedSupport::kMultisampled) {
if (!info.fIsMixedSampled || info.fColorDisabled) {
*antialiasMode = AntialiasMode::kMSAA;
*useHWAA = true;
return true;
}
- if (fLastSupportedAAMode >= AntialiasMode::kMixedSamples) {
+ if (fGpu->caps()->instancedSupport() >= GrCaps::InstancedSupport::kMixedSampled) {
*antialiasMode = AntialiasMode::kMixedSamples;
*useHWAA = true;
return true;
« no previous file with comments | « src/gpu/instanced/InstancedRendering.h ('k') | src/gpu/vk/GrVkGpu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698