Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
ShaderErrorHandler.cpp
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
9
12
13#include <functional>
14#include <string>
15
16namespace skgpu {
17
20 public:
21 void compileError(const char* shader, const char* errors) override {
22 std::string message = SkShaderUtils::BuildShaderErrorMessage(shader, errors);
23 SkShaderUtils::VisitLineByLine(message, [](int, const char* lineText) {
24 SkDebugf("%s\n", lineText);
25 });
26 SkDEBUGFAILF("Shader compilation failed!\n\n%s", message.c_str());
27 }
28 };
29
30 static DefaultShaderErrorHandler gHandler;
31 return &gHandler;
32}
33
34} // namespace SkShaderUtils
#define SkDEBUGFAILF(fmt,...)
Definition SkAssert.h:119
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
Win32Message message
void VisitLineByLine(const std::string &text, const std::function< void(int lineNumber, const char *lineText)> &visitFn)
std::string BuildShaderErrorMessage(const char *shader, const char *errors)
ShaderErrorHandler * DefaultShaderErrorHandler()