From a08288c38b6492c33bb74edbb5c4070d447d3dcb Mon Sep 17 00:00:00 2001 From: Kevin Lubick Date: Fri, 7 Apr 2023 11:27:24 -0400 Subject: [PATCH] Remove (unused) SkImageEncoder.h includes (flutter/engine#40989) I'm refactoring Skia's image codecs and noticed that although Flutter includes this header, it doesn't seem to use any of the symbols from it: `SkEncodeImage` and `SkEncodePixmap`. This PR removes those includes and also adds some missing includes which will aid future Skia cleanup CLs. ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide] and the [C++, Objective-C, Java style guides]. - [ ] I listed at least one issue that this PR fixes in the description above. - [x] I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt. See [testing the engine] for instructions on writing and running engine tests. - [ ] I updated/added relevant documentation (doc comments with `///`). - [x] I signed the [CLA]. - [ ] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. [Contributor Guide]: https://github.com/flutter/flutter/wiki/Tree-hygiene#overview [Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene [Flutter Style Guide]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style [testing the engine]: https://github.com/flutter/flutter/wiki/Testing-the-engine [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/wiki/Chat --- engine/src/flutter/flow/layer_snapshot_store.h | 4 +++- engine/src/flutter/flow/layers/offscreen_surface.cc | 5 +++-- engine/src/flutter/flow/layers/offscreen_surface.h | 3 +++ engine/src/flutter/shell/common/rasterizer.cc | 4 +++- engine/src/flutter/shell/common/rasterizer.h | 3 +++ 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/engine/src/flutter/flow/layer_snapshot_store.h b/engine/src/flutter/flow/layer_snapshot_store.h index eb444d2dcc3..2406335605c 100644 --- a/engine/src/flutter/flow/layer_snapshot_store.h +++ b/engine/src/flutter/flow/layer_snapshot_store.h @@ -10,8 +10,10 @@ #include "flutter/fml/logging.h" #include "flutter/fml/time/time_delta.h" -#include "third_party/skia/include/core/SkImageEncoder.h" +#include "third_party/skia/include/core/SkData.h" #include "third_party/skia/include/core/SkPictureRecorder.h" +#include "third_party/skia/include/core/SkRect.h" +#include "third_party/skia/include/core/SkRefCnt.h" #include "third_party/skia/include/core/SkSerialProcs.h" #include "third_party/skia/include/core/SkSurface.h" #include "third_party/skia/include/core/SkSurfaceCharacterization.h" diff --git a/engine/src/flutter/flow/layers/offscreen_surface.cc b/engine/src/flutter/flow/layers/offscreen_surface.cc index 199eace46d5..4f20fb0ac4e 100644 --- a/engine/src/flutter/flow/layers/offscreen_surface.cc +++ b/engine/src/flutter/flow/layers/offscreen_surface.cc @@ -4,10 +4,11 @@ #include "flutter/flow/layers/offscreen_surface.h" -#include "third_party/skia/include/core/SkImageEncoder.h" +#include "third_party/skia/include/core/SkColorSpace.h" +#include "third_party/skia/include/core/SkImageInfo.h" #include "third_party/skia/include/core/SkPictureRecorder.h" +#include "third_party/skia/include/core/SkPixmap.h" #include "third_party/skia/include/core/SkSerialProcs.h" -#include "third_party/skia/include/core/SkSurface.h" #include "third_party/skia/include/core/SkSurfaceCharacterization.h" #include "third_party/skia/include/utils/SkBase64.h" diff --git a/engine/src/flutter/flow/layers/offscreen_surface.h b/engine/src/flutter/flow/layers/offscreen_surface.h index 54e2fd2f6b0..6dabfb9eda6 100644 --- a/engine/src/flutter/flow/layers/offscreen_surface.h +++ b/engine/src/flutter/flow/layers/offscreen_surface.h @@ -10,6 +10,9 @@ #include "flutter/display_list/dl_canvas.h" #include "flutter/display_list/skia/dl_sk_canvas.h" +#include "third_party/skia/include/core/SkData.h" +#include "third_party/skia/include/core/SkRefCnt.h" +#include "third_party/skia/include/core/SkSize.h" #include "third_party/skia/include/core/SkSurface.h" class GrDirectContext; diff --git a/engine/src/flutter/shell/common/rasterizer.cc b/engine/src/flutter/shell/common/rasterizer.cc index 45335875da5..c2ae9dd1bed 100644 --- a/engine/src/flutter/shell/common/rasterizer.cc +++ b/engine/src/flutter/shell/common/rasterizer.cc @@ -15,9 +15,11 @@ #include "flutter/fml/time/time_point.h" #include "flutter/shell/common/serialization_callbacks.h" #include "fml/make_copyable.h" -#include "third_party/skia/include/core/SkImageEncoder.h" +#include "third_party/skia/include/core/SkImageInfo.h" +#include "third_party/skia/include/core/SkMatrix.h" #include "third_party/skia/include/core/SkPictureRecorder.h" #include "third_party/skia/include/core/SkSerialProcs.h" +#include "third_party/skia/include/core/SkSize.h" #include "third_party/skia/include/core/SkSurface.h" #include "third_party/skia/include/core/SkSurfaceCharacterization.h" #include "third_party/skia/include/utils/SkBase64.h" diff --git a/engine/src/flutter/shell/common/rasterizer.h b/engine/src/flutter/shell/common/rasterizer.h index 5249a4154cc..a122820c427 100644 --- a/engine/src/flutter/shell/common/rasterizer.h +++ b/engine/src/flutter/shell/common/rasterizer.h @@ -27,7 +27,10 @@ #include "flutter/shell/common/pipeline.h" #include "flutter/shell/common/snapshot_controller.h" #include "flutter/shell/common/snapshot_surface_producer.h" +#include "third_party/skia/include/core/SkData.h" #include "third_party/skia/include/core/SkImage.h" +#include "third_party/skia/include/core/SkRect.h" +#include "third_party/skia/include/core/SkRefCnt.h" #include "third_party/skia/include/gpu/GrDirectContext.h" namespace flutter {