Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
skia
src
sksl
SkSLErrorReporter.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 SKSL_ERROR_REPORTER
9
#define SKSL_ERROR_REPORTER
10
11
#include "
include/core/SkTypes.h
"
12
13
#include <string_view>
14
15
namespace
SkSL
{
16
17
class
Position;
18
19
/**
20
* Class which is notified in the event of an error.
21
*/
22
class
ErrorReporter
{
23
public
:
24
ErrorReporter
() {}
25
26
virtual
~ErrorReporter
() {}
27
28
void
error
(
Position
position, std::string_view msg);
29
30
std::string_view
source
()
const
{
return
fSource; }
31
32
void
setSource
(std::string_view
source
) { fSource =
source
; }
33
34
int
errorCount
()
const
{
35
return
fErrorCount;
36
}
37
38
void
resetErrorCount
() {
39
fErrorCount = 0;
40
}
41
42
protected
:
43
/**
44
* Called when an error is reported.
45
*/
46
virtual
void
handleError
(std::string_view msg,
Position
position) = 0;
47
48
private
:
49
Position
position(
int
offset
)
const
;
50
51
std::string_view fSource;
52
int
fErrorCount = 0;
53
};
54
55
/**
56
* Error reporter for tests that need an SkSL context; aborts immediately if an error is reported.
57
*/
58
class
TestingOnly_AbortErrorReporter
:
public
ErrorReporter
{
59
public
:
60
void
handleError
(std::string_view msg,
Position
pos
)
override
;
61
};
62
63
}
// namespace SkSL
64
65
#endif
pos
SkPoint pos
Definition
ImageShaderTest.cpp:27
SkTypes.h
SkSL::ErrorReporter
Definition
SkSLErrorReporter.h:22
SkSL::ErrorReporter::setSource
void setSource(std::string_view source)
Definition
SkSLErrorReporter.h:32
SkSL::ErrorReporter::ErrorReporter
ErrorReporter()
Definition
SkSLErrorReporter.h:24
SkSL::ErrorReporter::resetErrorCount
void resetErrorCount()
Definition
SkSLErrorReporter.h:38
SkSL::ErrorReporter::handleError
virtual void handleError(std::string_view msg, Position position)=0
SkSL::ErrorReporter::source
std::string_view source() const
Definition
SkSLErrorReporter.h:30
SkSL::ErrorReporter::errorCount
int errorCount() const
Definition
SkSLErrorReporter.h:34
SkSL::ErrorReporter::~ErrorReporter
virtual ~ErrorReporter()
Definition
SkSLErrorReporter.h:26
SkSL::Position
Definition
SkSLPosition.h:18
SkSL::TestingOnly_AbortErrorReporter
Definition
SkSLErrorReporter.h:58
SkSL::TestingOnly_AbortErrorReporter::handleError
void handleError(std::string_view msg, Position pos) override
Definition
SkSLErrorReporter.cpp:25
error
const uint8_t uint32_t uint32_t GError ** error
Definition
fl_pixel_buffer_texture_test.cc:40
SkSL
Definition
SkCapabilities.h:15
offset
Point offset
Definition
stroke_path_geometry.cc:256
Generated on Fri Apr 26 2024 06:17:33 for Flutter Engine by
1.9.8