Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
SkSpecialImage_Ganesh.h
Go to the documentation of this file.
1/*
2 * Copyright 2019 Google LLC
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef SkSpecialImageGanesh_DEFINED
9#define SkSpecialImageGanesh_DEFINED
10
14
15#include <cstdint>
16
18class SkImage;
19class SkSpecialImage;
20class SkSurfaceProps;
21struct SkIRect;
22
23namespace SkSpecialImages {
24
25sk_sp<SkSpecialImage> MakeFromTextureImage(GrRecordingContext* rContext,
26 const SkIRect& subset,
28 const SkSurfaceProps& props);
29
30sk_sp<SkSpecialImage> MakeDeferredFromGpu(GrRecordingContext*,
31 const SkIRect& subset,
32 uint32_t uniqueID,
34 const GrColorInfo&,
35 const SkSurfaceProps&);
36
37/**
38 * Regardless of how the underlying backing data is stored, returns the contents as a
39 * GrSurfaceProxyView. The returned view's proxy represents the entire backing image, so texture
40 * coordinates must be mapped from the content rect (e.g. relative to 'subset()') to the proxy's
41 * space (offset by subset().topLeft()).
42 */
44inline GrSurfaceProxyView AsView(GrRecordingContext* rContext,
45 const sk_sp<const SkSpecialImage>& img) {
46 return AsView(rContext, img.get());
47}
48
49} // namespace SkSpecialImages
50
51#endif
T * get() const
Definition SkRefCnt.h:303
sk_sp< SkImage > image
Definition examples.cpp:29
std::tuple< GrSurfaceProxyView, GrColorType > AsView(GrRecordingContext *rContext, const SkImage *img, skgpu::Mipmapped mipmapped, GrImageTexGenPolicy policy)