Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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
13#include "src/core/SkBlitter.h"
14#include "src/core/SkDrawBase.h"
17
18class SkMatrix;
19class SkPaint;
20class SkPixmap;
21
23public:
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
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(),
45 return fBlitter;
46 }
47
48private:
49 // Owned by fAlloc, which will handle the delete.
50 SkBlitter* fBlitter = nullptr;
51
53};
54
55#endif
#define SkASSERT(cond)
Definition SkAssert.h:116
static SkSurfaceProps SkSurfacePropsCopyOrDefault(const SkSurfaceProps *props)
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition aaclip.cpp:27
SkBlitter * choose(const SkDrawBase &draw, const SkMatrix *ctm, const SkPaint &paint, bool drawCoverage=false)
SkBlitter * get() const
SkAutoBlitterChoose(const SkDrawBase &draw, const SkMatrix *ctm, const SkPaint &paint, bool drawCoverage=false)
const Paint & paint