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

Unified Diff: gm/surface.cpp

Issue 2257643003: remove disable aa/dither flags from Props -- never used (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: restore gm, only remove disable aspects Created 4 years, 4 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 | « no previous file | include/core/SkSurfaceProps.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/surface.cpp
diff --git a/gm/surface.cpp b/gm/surface.cpp
index 6846f727e2d2bfd949024eeb6ae4145643099899..7c0b0c9d9fea997fcb22df40ab2b9563a7454237 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;
}
}
« no previous file with comments | « no previous file | include/core/SkSurfaceProps.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698