Flutter Engine
The Flutter Engine
GrBackendDrawableInfo.h
Go to the documentation of this file.
1/*
2 * Copyright 2018 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 GrBackendDrawableInfo_DEFINED
9#define GrBackendDrawableInfo_DEFINED
10
11#include "include/gpu/GrTypes.h"
12
14
15// If necessary, this could be pulled into a generic interface, but at this point, we only expect
16// it to be used by the Ganesh Vulkan backend.
18public:
19 // Creates an invalid backend drawable info.
21
23 : fIsValid(true)
24 , fBackend(GrBackendApi::kVulkan)
25 , fVkInfo(info) {}
26
27 // Returns true if the backend texture has been initialized.
28 bool isValid() const { return fIsValid; }
29
30 GrBackendApi backend() const { return fBackend; }
31
32 bool getVkDrawableInfo(GrVkDrawableInfo* outInfo) const {
33 if (this->isValid() && GrBackendApi::kVulkan == fBackend) {
34 *outInfo = fVkInfo;
35 return true;
36 }
37 return false;
38 }
39
40private:
41 bool fIsValid;
42 GrBackendApi fBackend;
43 GrVkDrawableInfo fVkInfo;
44};
45
46#endif
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition: DM.cpp:213
GrBackendApi
Definition: GrTypes.h:95
#define SK_API
Definition: SkAPI.h:35
GrBackendApi backend() const
bool getVkDrawableInfo(GrVkDrawableInfo *outInfo) const
GrBackendDrawableInfo(const GrVkDrawableInfo &info)