Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
GrDstProxyView.h
Go to the documentation of this file.
1/*
2 * Copyright 2021 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 GrDstProxyView_DEFINED
9#define GrDstProxyView_DEFINED
10
11#include "include/gpu/GrTypes.h"
14
15/**
16 * GrDstProxyView holds a texture containing the destination pixel values, and an integer-coordinate
17 * offset from device-space to the space of the texture. When framebuffer fetch is not available, a
18 * GrDstProxyView may be used to support blending in the fragment shader/xfer processor.
19 */
21public:
23
25 *this = other;
26 }
27
29 fProxyView = other.fProxyView;
30 fOffset = other.fOffset;
31 fDstSampleFlags = other.fDstSampleFlags;
32 return *this;
33 }
34
35 bool operator==(const GrDstProxyView& that) const {
36 return fProxyView == that.fProxyView &&
37 fOffset == that.fOffset &&
38 fDstSampleFlags == that.fDstSampleFlags;
39 }
40 bool operator!=(const GrDstProxyView& that) const { return !(*this == that); }
41
42 const SkIPoint& offset() const { return fOffset; }
43
44 void setOffset(const SkIPoint& offset) { fOffset = offset; }
45 void setOffset(int ox, int oy) { fOffset.set(ox, oy); }
46
47 GrSurfaceProxy* proxy() const { return fProxyView.proxy(); }
48 const GrSurfaceProxyView& proxyView() const { return fProxyView; }
49
51 fProxyView = std::move(view);
52 if (!fProxyView.proxy()) {
53 fOffset = {0, 0};
54 }
55 }
56
57 GrDstSampleFlags dstSampleFlags() const { return fDstSampleFlags; }
58
60
61 using sk_is_trivially_relocatable = std::true_type;
62
63private:
64 GrSurfaceProxyView fProxyView;
65 SkIPoint fOffset = {0, 0};
67
68 static_assert(::sk_is_trivially_relocatable<decltype(fProxyView)>::value);
69 static_assert(::sk_is_trivially_relocatable<decltype(fOffset)>::value);
70 static_assert(::sk_is_trivially_relocatable<decltype(fDstSampleFlags)>::value);
71};
72
73#endif
GrDstSampleFlags
void setOffset(const SkIPoint &offset)
GrDstProxyView & operator=(const GrDstProxyView &other)
GrDstSampleFlags dstSampleFlags() const
void setDstSampleFlags(GrDstSampleFlags dstSampleFlags)
const SkIPoint & offset() const
GrSurfaceProxy * proxy() const
void setProxyView(GrSurfaceProxyView view)
const GrSurfaceProxyView & proxyView() const
void setOffset(int ox, int oy)
bool operator!=(const GrDstProxyView &that) const
std::true_type sk_is_trivially_relocatable
GrDstProxyView(const GrDstProxyView &other)
bool operator==(const GrDstProxyView &that) const
GrSurfaceProxy * proxy() const
void set(int32_t x, int32_t y)