Flutter Engine
The Flutter Engine
third_party
skia
src
core
SkAutoBlitterChoose.h
Go to the documentation of this file.
1
/*
2
* Copyright 2017 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 SkAutoBlitterChoose_DEFINED
9
#define SkAutoBlitterChoose_DEFINED
10
11
#include "
include/private/base/SkMacros.h
"
12
#include "
src/base/SkArenaAlloc.h
"
13
#include "
src/core/SkBlitter.h
"
14
#include "
src/core/SkDrawBase.h
"
15
#include "
src/core/SkRasterClip.h
"
16
#include "
src/core/SkSurfacePriv.h
"
17
18
class
SkMatrix
;
19
class
SkPaint
;
20
class
SkPixmap
;
21
22
class
SkAutoBlitterChoose
:
SkNoncopyable
{
23
public
:
24
SkAutoBlitterChoose
() {}
25
SkAutoBlitterChoose
(
const
SkDrawBase
&
draw
,
26
const
SkMatrix
* ctm,
27
const
SkPaint
&
paint
,
28
bool
drawCoverage =
false
) {
29
this->
choose
(draw, ctm,
paint
, drawCoverage);
30
}
31
32
SkBlitter
*
operator->
() {
return
fBlitter; }
33
SkBlitter
*
get
()
const
{
return
fBlitter; }
34
35
SkBlitter
*
choose
(
const
SkDrawBase
&
draw
,
const
SkMatrix
* ctm,
36
const
SkPaint
&
paint
,
bool
drawCoverage =
false
) {
37
SkASSERT
(!fBlitter);
38
fBlitter =
draw
.fBlitterChooser(
draw
.fDst,
39
ctm ? *ctm : *
draw
.fCTM,
40
paint
,
41
&fAlloc,
42
drawCoverage,
43
draw
.fRC->clipShader(),
44
SkSurfacePropsCopyOrDefault
(
draw
.fProps));
45
return
fBlitter;
46
}
47
48
private
:
49
// Owned by fAlloc, which will handle the delete.
50
SkBlitter
* fBlitter =
nullptr
;
51
52
SkSTArenaAlloc<kSkBlitterContextSize>
fAlloc;
53
};
54
55
#endif
SkArenaAlloc.h
SkASSERT
#define SkASSERT(cond)
Definition:
SkAssert.h:116
SkBlitter.h
SkDrawBase.h
SkMacros.h
SkRasterClip.h
SkSurfacePriv.h
SkSurfacePropsCopyOrDefault
static SkSurfaceProps SkSurfacePropsCopyOrDefault(const SkSurfaceProps *props)
Definition:
SkSurfacePriv.h:15
draw
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition:
aaclip.cpp:27
SkAutoBlitterChoose
Definition:
SkAutoBlitterChoose.h:22
SkAutoBlitterChoose::choose
SkBlitter * choose(const SkDrawBase &draw, const SkMatrix *ctm, const SkPaint &paint, bool drawCoverage=false)
Definition:
SkAutoBlitterChoose.h:35
SkAutoBlitterChoose::get
SkBlitter * get() const
Definition:
SkAutoBlitterChoose.h:33
SkAutoBlitterChoose::SkAutoBlitterChoose
SkAutoBlitterChoose(const SkDrawBase &draw, const SkMatrix *ctm, const SkPaint &paint, bool drawCoverage=false)
Definition:
SkAutoBlitterChoose.h:25
SkAutoBlitterChoose::SkAutoBlitterChoose
SkAutoBlitterChoose()
Definition:
SkAutoBlitterChoose.h:24
SkAutoBlitterChoose::operator->
SkBlitter * operator->()
Definition:
SkAutoBlitterChoose.h:32
SkBlitter
Definition:
SkBlitter.h:38
SkDrawBase
Definition:
SkDrawBase.h:40
SkMatrix
Definition:
SkMatrix.h:54
SkNoncopyable
Definition:
SkNoncopyable.h:18
SkPaint
Definition:
SkPaint.h:44
SkPixmap
Definition:
SkPixmap.h:40
SkSTArenaAlloc< kSkBlitterContextSize >
paint
const Paint & paint
Definition:
color_source.cc:38
Generated on Sun Jun 23 2024 21:56:10 for Flutter Engine by
1.9.4