Skip to content

Commit 519b237

Browse files
authored
Clean up Skia includes around SkSurfaceCharacterization (flutter#42485)
While contemplating a change to SkSurfaceCharacterization, I was curious who was using this. Flutter #included it, but never actually seemed to use it. Thus, I removed includes of it and other unnecessary #includes in those same files, as well as addressing follow-on compile errors. ## 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]. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. <!-- Links --> [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
1 parent 3a453f2 commit 519b237

6 files changed

Lines changed: 17 additions & 14 deletions

File tree

flow/layer_snapshot_store.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,8 @@
1111
#include "flutter/fml/time/time_delta.h"
1212

1313
#include "third_party/skia/include/core/SkData.h"
14-
#include "third_party/skia/include/core/SkPictureRecorder.h"
1514
#include "third_party/skia/include/core/SkRect.h"
1615
#include "third_party/skia/include/core/SkRefCnt.h"
17-
#include "third_party/skia/include/core/SkSerialProcs.h"
18-
#include "third_party/skia/include/core/SkSurface.h"
19-
#include "third_party/skia/include/core/SkSurfaceCharacterization.h"
20-
#include "third_party/skia/include/utils/SkBase64.h"
2116

2217
namespace flutter {
2318

flow/layers/offscreen_surface.cc

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,13 @@
55
#include "flutter/flow/layers/offscreen_surface.h"
66

77
#include "third_party/skia/include/core/SkColorSpace.h"
8+
#include "third_party/skia/include/core/SkData.h"
89
#include "third_party/skia/include/core/SkImage.h"
910
#include "third_party/skia/include/core/SkImageInfo.h"
10-
#include "third_party/skia/include/core/SkPictureRecorder.h"
1111
#include "third_party/skia/include/core/SkPixmap.h"
12-
#include "third_party/skia/include/core/SkSerialProcs.h"
13-
#include "third_party/skia/include/core/SkSurfaceCharacterization.h"
1412
#include "third_party/skia/include/encode/SkPngEncoder.h"
13+
#include "third_party/skia/include/gpu/GrDirectContext.h"
1514
#include "third_party/skia/include/gpu/ganesh/SkSurfaceGanesh.h"
16-
#include "third_party/skia/include/utils/SkBase64.h"
1715

1816
namespace flutter {
1917

@@ -24,9 +22,8 @@ static sk_sp<SkSurface> CreateSnapshotSurface(GrDirectContext* surface_context,
2422
if (surface_context) {
2523
// There is a rendering surface that may contain textures that are going to
2624
// be referenced in the layer tree about to be drawn.
27-
return SkSurfaces::RenderTarget(
28-
reinterpret_cast<GrRecordingContext*>(surface_context),
29-
skgpu::Budgeted::kNo, image_info);
25+
return SkSurfaces::RenderTarget(surface_context, skgpu::Budgeted::kNo,
26+
image_info);
3027
}
3128

3229
// There is no rendering surface, assume no GPU textures are present and

flow/testing/mock_raster_cache.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
#include "flutter/flow/raster_cache_item.h"
1212
#include "flutter/flow/testing/mock_layer.h"
1313
#include "flutter/testing/mock_canvas.h"
14-
#include "third_party/skia/include/core/SkImage.h"
14+
#include "third_party/skia/include/core/SkColorSpace.h"
15+
#include "third_party/skia/include/core/SkRefCnt.h"
16+
#include "third_party/skia/include/core/SkSize.h"
1517

1618
namespace flutter {
1719
namespace testing {

shell/common/rasterizer.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,17 @@
1515
#include "flutter/fml/time/time_point.h"
1616
#include "flutter/shell/common/serialization_callbacks.h"
1717
#include "fml/make_copyable.h"
18+
#include "third_party/skia/include/core/SkColorSpace.h"
19+
#include "third_party/skia/include/core/SkData.h"
20+
#include "third_party/skia/include/core/SkImage.h"
1821
#include "third_party/skia/include/core/SkImageInfo.h"
1922
#include "third_party/skia/include/core/SkMatrix.h"
2023
#include "third_party/skia/include/core/SkPictureRecorder.h"
24+
#include "third_party/skia/include/core/SkRect.h"
2125
#include "third_party/skia/include/core/SkSerialProcs.h"
2226
#include "third_party/skia/include/core/SkSize.h"
2327
#include "third_party/skia/include/core/SkSurface.h"
24-
#include "third_party/skia/include/core/SkSurfaceCharacterization.h"
28+
#include "third_party/skia/include/gpu/GrDirectContext.h"
2529
#include "third_party/skia/include/gpu/ganesh/SkSurfaceGanesh.h"
2630
#include "third_party/skia/include/utils/SkBase64.h"
2731

shell/common/rasterizer_unittests.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include "flutter/shell/common/thread_host.h"
1616
#include "flutter/testing/testing.h"
1717

18+
#include "third_party/skia/include/core/SkColorSpace.h"
1819
#include "third_party/skia/include/core/SkSurface.h"
1920
#include "third_party/skia/include/gpu/ganesh/SkSurfaceGanesh.h"
2021

shell/platform/embedder/pixel_formats.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
#include "flutter/shell/platform/embedder/pixel_formats.h"
66
#include "flutter/shell/platform/embedder/embedder.h"
77

8+
#include "third_party/skia/include/core/SkColorSpace.h"
9+
#include "third_party/skia/include/core/SkColorType.h"
10+
#include "third_party/skia/include/core/SkImageInfo.h"
11+
812
std::optional<SkColorType> getSkColorType(FlutterSoftwarePixelFormat pixfmt) {
913
switch (pixfmt) {
1014
case kFlutterSoftwarePixelFormatGray8:

0 commit comments

Comments
 (0)