aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/gpu/GrDrawContext.h
diff options
context:
space:
mode:
authorGravatar csmartdalton <csmartdalton@google.com>2016-06-08 10:08:43 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-06-08 10:08:43 -0700
commitecbc12b1c1c72de0cf7bba4a3f6a7cce4f43bf41 (patch)
tree82d33bb0118105ba8da507f814257b3ed44f434b /include/gpu/GrDrawContext.h
parent5c7d62d431a0ad7988f05fbdb206237729c0c308 (diff)
Replace targetHasUnifiedMultisampling in GrPB constructor
Replaces targetHasUnifiedMultisampling with a simpler "useHWAA". Now the code that creates a pipeline builder needs to decide on its own whether it should enable multisampling, rather than relying on the builder to try and guess. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2041283002 Review-Url: https://codereview.chromium.org/2041283002
Diffstat (limited to 'include/gpu/GrDrawContext.h')
-rw-r--r--include/gpu/GrDrawContext.h16
1 files changed, 7 insertions, 9 deletions
diff --git a/include/gpu/GrDrawContext.h b/include/gpu/GrDrawContext.h
index c4818e5d71..f56570b10b 100644
--- a/include/gpu/GrDrawContext.h
+++ b/include/gpu/GrDrawContext.h
@@ -9,6 +9,7 @@
#define GrDrawContext_DEFINED
#include "GrColor.h"
+#include "GrPaint.h"
#include "GrRenderTarget.h"
#include "SkRefCnt.h"
#include "SkRegion.h"
@@ -250,20 +251,16 @@ public:
const SkIRect& center,
const SkRect& dst);
- /**
- * Draws a batch
- *
- * @param paint describes how to color pixels.
- * @param batch the batch to draw
- */
- void drawBatch(const GrClip&, const GrPaint&, GrDrawBatch*);
-
bool isStencilBufferMultisampled() const {
return fRenderTarget->isStencilBufferMultisampled();
}
bool isUnifiedMultisampled() const { return fRenderTarget->isUnifiedMultisampled(); }
bool hasMixedSamples() const { return fRenderTarget->hasMixedSamples(); }
+ bool mustUseHWAA(const GrPaint& paint) const {
+ return paint.isAntiAlias() && fRenderTarget->isUnifiedMultisampled();
+ }
+
const GrSurfaceDesc& desc() const { return fRenderTarget->desc(); }
int width() const { return fRenderTarget->width(); }
int height() const { return fRenderTarget->height(); }
@@ -326,7 +323,8 @@ private:
GrDrawBatch* getFillRectBatch(const GrPaint& paint,
const SkMatrix& viewMatrix,
- const SkRect& rect);
+ const SkRect& rect,
+ bool* useHWAA);
void internalDrawPath(const GrClip& clip,
const GrPaint& paint,