skia2/tools/graphite/GraphiteTestContext.h
Robert Phillips d034db791d [graphite] Add GraphiteTestContext
Bug: skia:12466
Change-Id: I90ebec9ee744de3822bd82d474858015d2490d72
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/453636
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2021-09-29 19:09:48 +00:00

41 lines
939 B
C++

/*
* Copyright 2021 Google LLC
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef skgpu_GraphiteTestContext_DEFINED
#define skgpu_GraphiteTestContext_DEFINED
#include "experimental/graphite/include/GraphiteTypes.h"
#include "include/core/SkRefCnt.h"
namespace skgpu { class Context; }
namespace sk_graphite_test {
/**
* An offscreen 3D context. This class is intended for Skia's internal testing needs and not
* for general use.
*/
class GraphiteTestContext {
public:
GraphiteTestContext(const GraphiteTestContext&) = delete;
GraphiteTestContext& operator=(const GraphiteTestContext&) = delete;
virtual ~GraphiteTestContext();
virtual skgpu::BackendApi backend() = 0;
virtual sk_sp<skgpu::Context> makeContext() = 0;
protected:
GraphiteTestContext();
};
} // namespace sk_graphite_test
#endif // skgpu_GraphiteTestContext_DEFINED