Flutter Engine
The Flutter Engine
third_party
skia
src
gpu
ganesh
GrWindowRectsState.h
Go to the documentation of this file.
1
/*
2
* Copyright 2016 Google Inc.
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 GrWindowRectsState_DEFINED
9
#define GrWindowRectsState_DEFINED
10
11
#include "
src/gpu/ganesh/GrWindowRectangles.h
"
12
13
class
GrWindowRectsState
{
14
public
:
15
enum class
Mode
:
bool
{
16
kExclusive,
17
kInclusive
18
};
19
20
GrWindowRectsState
() : fMode(
Mode
::kExclusive) {}
21
GrWindowRectsState
(
const
GrWindowRectangles
&
windows
,
Mode
mode
)
22
: fMode(
mode
)
23
, fWindows(
windows
) {
24
}
25
26
bool
enabled
()
const
{
return
Mode::kInclusive
== fMode || !fWindows.
empty
(); }
27
Mode
mode
()
const
{
return
fMode; }
28
const
GrWindowRectangles
&
windows
()
const
{
return
fWindows; }
29
int
numWindows
()
const
{
return
fWindows.
count
(); }
30
31
void
setDisabled
() {
32
fMode =
Mode::kExclusive
;
33
fWindows.
reset
();
34
}
35
36
void
set
(
const
GrWindowRectangles
&
windows
,
Mode
mode
) {
37
fMode =
mode
;
38
fWindows =
windows
;
39
}
40
41
bool
operator==
(
const
GrWindowRectsState
& that)
const
{
42
if
(fMode != that.fMode) {
43
return
false
;
44
}
45
return
fWindows == that.fWindows;
46
}
47
bool
operator!=
(
const
GrWindowRectsState
& that)
const
{
return
!(*
this
== that); }
48
49
private
:
50
Mode
fMode;
51
GrWindowRectangles
fWindows;
52
};
53
54
#endif
Mode
Mode
Definition:
ColorSpaceBench.cpp:18
GrWindowRectangles.h
GrWindowRectangles
Definition:
GrWindowRectangles.h:14
GrWindowRectangles::count
int count() const
Definition:
GrWindowRectangles.h:25
GrWindowRectangles::empty
bool empty() const
Definition:
GrWindowRectangles.h:24
GrWindowRectangles::reset
void reset()
Definition:
GrWindowRectangles.h:63
GrWindowRectsState
Definition:
GrWindowRectsState.h:13
GrWindowRectsState::mode
Mode mode() const
Definition:
GrWindowRectsState.h:27
GrWindowRectsState::enabled
bool enabled() const
Definition:
GrWindowRectsState.h:26
GrWindowRectsState::GrWindowRectsState
GrWindowRectsState(const GrWindowRectangles &windows, Mode mode)
Definition:
GrWindowRectsState.h:21
GrWindowRectsState::operator!=
bool operator!=(const GrWindowRectsState &that) const
Definition:
GrWindowRectsState.h:47
GrWindowRectsState::windows
const GrWindowRectangles & windows() const
Definition:
GrWindowRectsState.h:28
GrWindowRectsState::Mode
Mode
Definition:
GrWindowRectsState.h:15
GrWindowRectsState::Mode::kInclusive
@ kInclusive
GrWindowRectsState::Mode::kExclusive
@ kExclusive
GrWindowRectsState::operator==
bool operator==(const GrWindowRectsState &that) const
Definition:
GrWindowRectsState.h:41
GrWindowRectsState::GrWindowRectsState
GrWindowRectsState()
Definition:
GrWindowRectsState.h:20
GrWindowRectsState::numWindows
int numWindows() const
Definition:
GrWindowRectsState.h:29
GrWindowRectsState::set
void set(const GrWindowRectangles &windows, Mode mode)
Definition:
GrWindowRectsState.h:36
GrWindowRectsState::setDisabled
void setDisabled()
Definition:
GrWindowRectsState.h:31
Generated on Sun Jun 23 2024 21:56:21 for Flutter Engine by
1.9.4