aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/surface.cpp
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2016-08-18 09:30:44 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-08-18 09:30:44 -0700
commit7c1235457f7ef69d3bde48306e9be528718da7e6 (patch)
tree0c495d7c91f194507d7d5063ddbd50cc0a5e089e /gm/surface.cpp
parent6d391b6c37c66770913aaecc50ddb466705dde31 (diff)
remove disable aa/dither flags from Props -- never used
Diffstat (limited to 'gm/surface.cpp')
-rw-r--r--gm/surface.cpp40
1 files changed, 12 insertions, 28 deletions
diff --git a/gm/surface.cpp b/gm/surface.cpp
index 6846f727e2..7c0b0c9d9f 100644
--- a/gm/surface.cpp
+++ b/gm/surface.cpp
@@ -21,17 +21,8 @@ static sk_sp<SkShader> make_shader() {
return SkGradientShader::MakeLinear(pts, colors, nullptr, 2, SkShader::kClamp_TileMode);
}
-static sk_sp<SkSurface> make_surface(GrContext* ctx, const SkImageInfo& info, SkPixelGeometry geo,
- int disallowAA, int disallowDither) {
- uint32_t flags = 0;
- if (disallowAA) {
- flags |= SkSurfaceProps::kDisallowAntiAlias_Flag;
- }
- if (disallowDither) {
- flags |= SkSurfaceProps::kDisallowDither_Flag;
- }
-
- SkSurfaceProps props(flags, geo);
+static sk_sp<SkSurface> make_surface(GrContext* ctx, const SkImageInfo& info, SkPixelGeometry geo) {
+ SkSurfaceProps props(0, geo);
if (ctx) {
return SkSurface::MakeRenderTarget(ctx, SkBudgeted::kNo, info, 0, &props);
} else {
@@ -67,7 +58,7 @@ protected:
}
SkISize onISize() override {
- return SkISize::Make(W * 4, H * 5);
+ return SkISize::Make(W, H * 5);
}
void onDraw(SkCanvas* canvas) override {
@@ -89,23 +80,16 @@ protected:
};
SkScalar x = 0;
- for (int disallowAA = 0; disallowAA <= 1; ++disallowAA) {
- for (int disallowDither = 0; disallowDither <= 1; ++disallowDither) {
- SkScalar y = 0;
- for (const auto& rec : recs) {
- auto surface(make_surface(ctx, info, rec.fGeo, disallowAA, disallowDither));
- if (!surface) {
- SkDebugf("failed to create surface! label: %s AA: %s dither: %s\n",
- rec.fLabel, (disallowAA == 1 ? "disallowed" : "allowed"),
- (disallowDither == 1 ? "disallowed" : "allowed"));
- continue;
- }
- test_draw(surface->getCanvas(), rec.fLabel);
- surface->draw(canvas, x, y, nullptr);
- y += H;
- }
- x += W;
+ SkScalar y = 0;
+ for (const auto& rec : recs) {
+ auto surface(make_surface(ctx, info, rec.fGeo));
+ if (!surface) {
+ SkDebugf("failed to create surface! label: %s", rec.fLabel);
+ continue;
}
+ test_draw(surface->getCanvas(), rec.fLabel);
+ surface->draw(canvas, x, y, nullptr);
+ y += H;
}
}