Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 3342bd0

Browse files
authored
Migrate a few last places to GrDirectContext (#20235)
* Migrate a few last places to GrDirectContext This is a followup to #19962 to cover a few places where we were still using GrContext. No functional impact. * Formatting
1 parent d36c65c commit 3342bd0

File tree

7 files changed

+11
-10
lines changed

7 files changed

+11
-10
lines changed

flow/raster_cache.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class RasterCache {
6060
* to be stored in the cache.
6161
*
6262
* @param picture the SkPicture object to be cached.
63-
* @param context the GrContext used for rendering.
63+
* @param context the GrDirectContext used for rendering.
6464
* @param ctm the transformation matrix used for rendering.
6565
* @param dst_color_space the destination color space that the cached
6666
* rendering will be drawn into

flow/skia_gpu_object.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace flutter {
1111

1212
SkiaUnrefQueue::SkiaUnrefQueue(fml::RefPtr<fml::TaskRunner> task_runner,
1313
fml::TimeDelta delay,
14-
fml::WeakPtr<GrContext> context)
14+
fml::WeakPtr<GrDirectContext> context)
1515
: task_runner_(std::move(task_runner)),
1616
drain_delay_(delay),
1717
drain_pending_(false),

flow/skia_gpu_object.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ class SkiaUnrefQueue : public fml::RefCountedThreadSafe<SkiaUnrefQueue> {
3535
std::mutex mutex_;
3636
std::deque<SkRefCnt*> objects_;
3737
bool drain_pending_;
38-
fml::WeakPtr<GrContext> context_;
38+
fml::WeakPtr<GrDirectContext> context_;
3939

4040
// The `GrDirectContext* context` is only used for signaling Skia to
4141
// performDeferredCleanup. It can be nullptr when such signaling is not needed
4242
// (e.g., in unit tests).
4343
SkiaUnrefQueue(fml::RefPtr<fml::TaskRunner> task_runner,
4444
fml::TimeDelta delay,
45-
fml::WeakPtr<GrContext> context = {});
45+
fml::WeakPtr<GrDirectContext> context = {});
4646

4747
~SkiaUnrefQueue();
4848

lib/ui/painting/multi_frame_codec.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ static bool CopyToBitmap(SkBitmap* dst,
7575
}
7676

7777
sk_sp<SkImage> MultiFrameCodec::State::GetNextFrameImage(
78-
fml::WeakPtr<GrContext> resourceContext) {
78+
fml::WeakPtr<GrDirectContext> resourceContext) {
7979
SkBitmap bitmap = SkBitmap();
8080
SkImageInfo info = generator_->getInfo().makeColorType(kN32_SkColorType);
8181
if (info.alphaType() == kUnpremul_SkAlphaType) {
@@ -136,7 +136,7 @@ sk_sp<SkImage> MultiFrameCodec::State::GetNextFrameImage(
136136
void MultiFrameCodec::State::GetNextFrameAndInvokeCallback(
137137
std::unique_ptr<DartPersistentValue> callback,
138138
fml::RefPtr<fml::TaskRunner> ui_task_runner,
139-
fml::WeakPtr<GrContext> resourceContext,
139+
fml::WeakPtr<GrDirectContext> resourceContext,
140140
fml::RefPtr<flutter::SkiaUnrefQueue> unref_queue,
141141
size_t trace_id) {
142142
fml::RefPtr<FrameInfo> frameInfo = NULL;

lib/ui/painting/multi_frame_codec.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,13 @@ class MultiFrameCodec : public Codec {
5353
// The index of the last decoded required frame.
5454
int lastRequiredFrameIndex_ = -1;
5555

56-
sk_sp<SkImage> GetNextFrameImage(fml::WeakPtr<GrContext> resourceContext);
56+
sk_sp<SkImage> GetNextFrameImage(
57+
fml::WeakPtr<GrDirectContext> resourceContext);
5758

5859
void GetNextFrameAndInvokeCallback(
5960
std::unique_ptr<DartPersistentValue> callback,
6061
fml::RefPtr<fml::TaskRunner> ui_task_runner,
61-
fml::WeakPtr<GrContext> resourceContext,
62+
fml::WeakPtr<GrDirectContext> resourceContext,
6263
fml::RefPtr<flutter::SkiaUnrefQueue> unref_queue,
6364
size_t trace_id);
6465
};

lib/ui/ui_dart_state.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ fml::WeakPtr<SnapshotDelegate> UIDartState::GetSnapshotDelegate() const {
136136
return snapshot_delegate_;
137137
}
138138

139-
fml::WeakPtr<GrContext> UIDartState::GetResourceContext() const {
139+
fml::WeakPtr<GrDirectContext> UIDartState::GetResourceContext() const {
140140
if (!io_manager_) {
141141
return {};
142142
}

lib/ui/ui_dart_state.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class UIDartState : public tonic::DartState {
6060

6161
fml::WeakPtr<SnapshotDelegate> GetSnapshotDelegate() const;
6262

63-
fml::WeakPtr<GrContext> GetResourceContext() const;
63+
fml::WeakPtr<GrDirectContext> GetResourceContext() const;
6464

6565
fml::WeakPtr<ImageDecoder> GetImageDecoder() const;
6666

0 commit comments

Comments
 (0)