• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 GrMockOptions_DEFINED
9 #define GrMockOptions_DEFINED
10 
11 #include "GrTypes.h"
12 
13 struct GrMockTextureInfo {
14     int fID;
15 };
16 
17 /**
18  * A pointer to this type is used as the GrBackendContext when creating a Mock GrContext. It can be
19  * used to specificy capability options for the mock context. If nullptr is used a default
20  * constructed GrMockOptions is used.
21  */
22 struct GrMockOptions {
GrMockOptionsGrMockOptions23     GrMockOptions() {
24         // By default RGBA_8888 is textureable and renderable and A8 and RGB565 are texturable.
25         fConfigOptions[kRGBA_8888_GrPixelConfig].fRenderable[0] = true;
26         fConfigOptions[kRGBA_8888_GrPixelConfig].fTexturable = true;
27         fConfigOptions[kAlpha_8_GrPixelConfig].fTexturable = true;
28         fConfigOptions[kRGB_565_GrPixelConfig].fTexturable = true;
29     }
30 
31     struct ConfigOptions {
32         /** The first value is for non-MSAA rendering, the second for MSAA. */
33         bool fRenderable[2] = {false, false};
34         bool fTexturable = false;
35     };
36 
37     int fMaxTextureSize = 2048;
38     int fMaxRenderTargetSize = 2048;
39     int fMaxVertexAttributes = 16;
40     ConfigOptions fConfigOptions[kGrPixelConfigCnt];
41 };
42 
43 #endif
44