diff --git a/flow/BUILD.gn b/flow/BUILD.gn index ed6064ab2c98b83007a6198e01d2ba92657e784c..a5ef7f5c7b4535712c3934fd95932af475782e27 100644 --- a/flow/BUILD.gn +++ b/flow/BUILD.gn @@ -4,8 +4,6 @@ source_set("flow") { sources = [ - "checkerboard.cc", - "checkerboard.h", "compositor_context.cc", "compositor_context.h", "instrumentation.cc", diff --git a/flow/checkerboard.cc b/flow/checkerboard.cc deleted file mode 100644 index b88c0d1b147235c06e5bc7b9251f6e97fc24ca9a..0000000000000000000000000000000000000000 --- a/flow/checkerboard.cc +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2015 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "flow/checkerboard.h" - -#include "third_party/skia/include/core/SkShader.h" - -namespace flow { - -static sk_sp CreateCheckerboardShader(SkColor c1, - SkColor c2, - int size) { - SkBitmap bm; - bm.allocN32Pixels(2 * size, 2 * size); - bm.eraseColor(c1); - bm.eraseArea(SkIRect::MakeLTRB(0, 0, size, size), c2); - bm.eraseArea(SkIRect::MakeLTRB(size, size, 2 * size, 2 * size), c2); - return SkShader::MakeBitmapShader(bm, SkShader::kRepeat_TileMode, - SkShader::kRepeat_TileMode); -} - -static void DrawCheckerboard(SkCanvas* canvas, - SkColor c1, - SkColor c2, - int size) { - SkPaint paint; - paint.setShader(CreateCheckerboardShader(c1, c2, size)); - canvas->drawPaint(paint); -} - -void DrawCheckerboard(SkCanvas* canvas, const SkRect& rect) { - // Draw a checkerboard - canvas->save(); - canvas->clipRect(rect); - DrawCheckerboard(canvas, 0x4400FF00, 0x00000000, 12); - canvas->restore(); - - // Stroke the drawn area - SkPaint debugPaint; - debugPaint.setStrokeWidth(3); - debugPaint.setColor(SK_ColorRED); - debugPaint.setStyle(SkPaint::kStroke_Style); - canvas->drawRect(rect, debugPaint); -} - -} // namespace flow diff --git a/flow/checkerboard.h b/flow/checkerboard.h deleted file mode 100644 index 1107171a77a24b5c0b19cd9282ee5ff30e792069..0000000000000000000000000000000000000000 --- a/flow/checkerboard.h +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2015 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef FLOW_CHECKERBOARD_H_ -#define FLOW_CHECKERBOARD_H_ - -#include "third_party/skia/include/core/SkCanvas.h" - -namespace flow { - -void DrawCheckerboard(SkCanvas* canvas, const SkRect& rect); - -} // namespace flow - -#endif // FLOW_CHECKERBOARD_H_ diff --git a/flow/layers/picture_layer.cc b/flow/layers/picture_layer.cc index 11b2f3eb565101562de18fab219f8504e0cddb26..cb36901b6a2b28a16e3667a058af981fc9579794 100644 --- a/flow/layers/picture_layer.cc +++ b/flow/layers/picture_layer.cc @@ -4,15 +4,11 @@ #include "flow/layers/picture_layer.h" -#include "flow/checkerboard.h" #include "flow/raster_cache.h" #include "lib/ftl/logging.h" namespace flow { -// TODO(abarth): Make this configurable by developers. -const bool kDebugCheckerboardRasterizedLayers = false; - PictureLayer::PictureLayer() {} PictureLayer::~PictureLayer() {} @@ -32,8 +28,6 @@ void PictureLayer::Paint(PaintContext& context) { SkRect rect = picture_->cullRect().makeOffset(offset_.x(), offset_.y()); context.canvas.drawImageRect(image_.get(), rect, nullptr, SkCanvas::kFast_SrcRectConstraint); - if (kDebugCheckerboardRasterizedLayers) - DrawCheckerboard(&context.canvas, rect); } else { TRACE_EVENT1("flutter", "PictureLayer::Paint", "image", "normal"); SkAutoCanvasRestore save(&context.canvas, true);