mirror of
https://github.com/encounter/engine.git
synced 2026-03-30 11:09:55 -07:00
c7ec5bbc1c
If the image is a cross-context image that might be read from the GPU thread during onscreen rendering, then it is not safe to read it concurrently from the IO thread as part of Image.toByteData. If the GPU thread does not have a graphics context, then fall back to converting the image on the IO thread. Fixes https://github.com/flutter/flutter/issues/30697
24 lines
705 B
C++
24 lines
705 B
C++
// Copyright 2013 The Flutter 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 FLUTTER_LIB_UI_SNAPSHOT_DELEGATE_H_
|
|
#define FLUTTER_LIB_UI_SNAPSHOT_DELEGATE_H_
|
|
|
|
#include "third_party/skia/include/core/SkImage.h"
|
|
#include "third_party/skia/include/core/SkPicture.h"
|
|
|
|
namespace flutter {
|
|
|
|
class SnapshotDelegate {
|
|
public:
|
|
virtual sk_sp<SkImage> MakeRasterSnapshot(sk_sp<SkPicture> picture,
|
|
SkISize picture_size) = 0;
|
|
|
|
virtual sk_sp<SkImage> ConvertToRasterImage(sk_sp<SkImage> image) = 0;
|
|
};
|
|
|
|
} // namespace flutter
|
|
|
|
#endif // FLUTTER_LIB_UI_SNAPSHOT_DELEGATE_H_
|