Flutter Engine
The Flutter Engine
GrSurfaceProxyView.cpp
Go to the documentation of this file.
1/*
2 * Copyright 2022 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
9
10#include "include/core/SkRect.h"
14
16 return fProxy->uniqueID() == view.fProxy->uniqueID() && fOrigin == view.fOrigin &&
17 fSwizzle == view.fSwizzle;
18}
19
21 if (const GrTextureProxy* proxy = this->asTextureProxy()) {
22 return proxy->mipmapped();
23 }
25}
26
28 if (!fProxy) {
29 return nullptr;
30 }
31 return fProxy->asTextureProxy();
32}
33
35 return sk_ref_sp<GrTextureProxy>(this->asTextureProxy());
36}
37
39 if (!fProxy) {
40 return nullptr;
41 }
42 return fProxy->asRenderTargetProxy();
43}
44
46 return sk_ref_sp<GrRenderTargetProxy>(this->asRenderTargetProxy());
47}
48
50 fSwizzle = skgpu::Swizzle::Concat(fSwizzle, swizzle);
51}
52
54 return {fProxy, fOrigin, skgpu::Swizzle::Concat(fSwizzle, swizzle)};
55}
56
58 return {std::move(fProxy), fOrigin, skgpu::Swizzle::Concat(fSwizzle, swizzle)};
59}
60
61void GrSurfaceProxyView::reset() { *this = {}; }
62
65 skgpu::Mipmapped mipmapped,
66 SkIRect srcRect,
67 SkBackingFit fit,
68 skgpu::Budgeted budgeted,
69 std::string_view label) {
71 context, src.refProxy(), src.origin(), mipmapped, srcRect, fit, budgeted, label);
72 return {std::move(copy), src.origin(), src.swizzle()};
73}
74
77 skgpu::Mipmapped mipmapped,
78 SkBackingFit fit,
79 skgpu::Budgeted budgeted,
80 std::string_view label) {
82 rContext, src.refProxy(), src.origin(), mipmapped, fit, budgeted, label);
83 return {std::move(copy), src.origin(), src.swizzle()};
84}
const TextureProxy * fProxy
Definition: DrawPass.cpp:180
SkBackingFit
Definition: SkBackingFit.h:16
skgpu::Swizzle swizzle() const
skgpu::Mipmapped mipmapped() const
void concatSwizzle(skgpu::Swizzle swizzle)
GrTextureProxy * asTextureProxy() const
sk_sp< GrTextureProxy > asTextureProxyRef() const
GrSurfaceProxyView makeSwizzle(skgpu::Swizzle swizzle) const &
GrSurfaceProxy * proxy() const
GrRenderTargetProxy * asRenderTargetProxy() const
static GrSurfaceProxyView Copy(GrRecordingContext *context, GrSurfaceProxyView src, skgpu::Mipmapped mipmapped, SkIRect srcRect, SkBackingFit fit, skgpu::Budgeted budgeted, std::string_view label)
sk_sp< GrRenderTargetProxy > asRenderTargetProxyRef() const
bool operator==(const GrSurfaceProxyView &view) const
virtual GrRenderTargetProxy * asRenderTargetProxy()
static sk_sp< GrSurfaceProxy > Copy(GrRecordingContext *, sk_sp< GrSurfaceProxy > src, GrSurfaceOrigin, skgpu::Mipmapped, SkIRect srcRect, SkBackingFit, skgpu::Budgeted, std::string_view label, RectsMustMatch=RectsMustMatch::kNo, sk_sp< GrRenderTask > *outTask=nullptr)
virtual GrTextureProxy * asTextureProxy()
UniqueID uniqueID() const
static constexpr Swizzle Concat(const Swizzle &a, const Swizzle &b)
Definition: Swizzle.h:156
Definition: copy.py:1
Budgeted
Definition: GpuTypes.h:35
Mipmapped
Definition: GpuTypes.h:53
Definition: SkRect.h:32