File: context_state_test_helpers_autogen.h

package info (click to toggle)
chromium 120.0.6099.224-1~deb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 6,112,112 kB
  • sloc: cpp: 32,907,025; ansic: 8,148,123; javascript: 3,679,536; python: 2,031,248; asm: 959,718; java: 804,675; xml: 617,256; sh: 111,417; objc: 100,835; perl: 88,443; cs: 53,032; makefile: 29,579; fortran: 24,137; php: 21,162; tcl: 21,147; sql: 20,809; ruby: 17,735; pascal: 12,864; yacc: 8,045; lisp: 3,388; lex: 1,323; ada: 727; awk: 329; jsp: 267; csh: 117; exp: 43; sed: 37
file content (115 lines) | stat: -rw-r--r-- 4,839 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
// Copyright 2014 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// This file is auto-generated from
// gpu/command_buffer/build_gles2_cmd_buffer.py
// It's formatted by clang-format using chromium coding style:
//    clang-format -i -style=chromium filename
// DO NOT EDIT!

// It is included by context_state_test_helpers.cc
#ifndef GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_TEST_HELPERS_AUTOGEN_H_
#define GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_TEST_HELPERS_AUTOGEN_H_

void ContextStateTestHelpers::SetupInitCapabilitiesExpectations(
    MockGL* gl,
    gles2::FeatureInfo* feature_info) {
  ExpectEnableDisable(gl, GL_BLEND, false);
  ExpectEnableDisable(gl, GL_CULL_FACE, false);
  ExpectEnableDisable(gl, GL_DEPTH_TEST, false);
  ExpectEnableDisable(gl, GL_DITHER, true);
  ExpectEnableDisable(gl, GL_POLYGON_OFFSET_FILL, false);
  ExpectEnableDisable(gl, GL_SAMPLE_ALPHA_TO_COVERAGE, false);
  ExpectEnableDisable(gl, GL_SAMPLE_COVERAGE, false);
  ExpectEnableDisable(gl, GL_SCISSOR_TEST, false);
  ExpectEnableDisable(gl, GL_STENCIL_TEST, false);
  if (feature_info->feature_flags().ext_multisample_compatibility) {
    ExpectEnableDisable(gl, GL_MULTISAMPLE_EXT, true);
  }
  if (feature_info->feature_flags().ext_multisample_compatibility) {
    ExpectEnableDisable(gl, GL_SAMPLE_ALPHA_TO_ONE_EXT, false);
  }
  if (feature_info->IsES3Capable()) {
    ExpectEnableDisable(gl, GL_RASTERIZER_DISCARD, false);
    ExpectEnableDisable(gl, GL_PRIMITIVE_RESTART_FIXED_INDEX, false);
  }
}

void ContextStateTestHelpers::SetupInitStateExpectations(
    MockGL* gl,
    gles2::FeatureInfo* feature_info,
    const gfx::Size& initial_size) {
  EXPECT_CALL(*gl, BlendColor(0.0f, 0.0f, 0.0f, 0.0f))
      .Times(1)
      .RetiresOnSaturation();
  EXPECT_CALL(*gl, BlendEquationSeparate(GL_FUNC_ADD, GL_FUNC_ADD))
      .Times(1)
      .RetiresOnSaturation();
  EXPECT_CALL(*gl, BlendFuncSeparate(GL_ONE, GL_ZERO, GL_ONE, GL_ZERO))
      .Times(1)
      .RetiresOnSaturation();
  EXPECT_CALL(*gl, ClearColor(0.0f, 0.0f, 0.0f, 0.0f))
      .Times(1)
      .RetiresOnSaturation();
  EXPECT_CALL(*gl, ClearDepth(1.0f)).Times(1).RetiresOnSaturation();
  EXPECT_CALL(*gl, ClearStencil(0)).Times(1).RetiresOnSaturation();
  EXPECT_CALL(*gl, ColorMask(true, true, true, true))
      .Times(1)
      .RetiresOnSaturation();
  EXPECT_CALL(*gl, CullFace(GL_BACK)).Times(1).RetiresOnSaturation();
  EXPECT_CALL(*gl, DepthFunc(GL_LESS)).Times(1).RetiresOnSaturation();
  EXPECT_CALL(*gl, DepthMask(true)).Times(1).RetiresOnSaturation();
  EXPECT_CALL(*gl, DepthRange(0.0f, 1.0f)).Times(1).RetiresOnSaturation();
  EXPECT_CALL(*gl, FrontFace(GL_CCW)).Times(1).RetiresOnSaturation();
  if (!feature_info->gl_version_info().is_desktop_core_profile) {
    EXPECT_CALL(*gl, Hint(GL_GENERATE_MIPMAP_HINT, GL_DONT_CARE))
        .Times(1)
        .RetiresOnSaturation();
  }
  if (feature_info->feature_flags().oes_standard_derivatives) {
    EXPECT_CALL(*gl, Hint(GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES, GL_DONT_CARE))
        .Times(1)
        .RetiresOnSaturation();
  }
  if (feature_info->feature_flags().chromium_texture_filtering_hint) {
    EXPECT_CALL(*gl, Hint(GL_TEXTURE_FILTERING_HINT_CHROMIUM, GL_NICEST))
        .Times(1)
        .RetiresOnSaturation();
  }
  SetupInitStateManualExpectationsForDoLineWidth(gl, 1.0f);
  EXPECT_CALL(*gl, PixelStorei(GL_PACK_ALIGNMENT, 4))
      .Times(1)
      .RetiresOnSaturation();
  EXPECT_CALL(*gl, PixelStorei(GL_UNPACK_ALIGNMENT, 4))
      .Times(1)
      .RetiresOnSaturation();
  EXPECT_CALL(*gl, PolygonOffset(0.0f, 0.0f)).Times(1).RetiresOnSaturation();
  EXPECT_CALL(*gl, SampleCoverage(1.0f, false)).Times(1).RetiresOnSaturation();
  EXPECT_CALL(*gl, Scissor(0, 0, initial_size.width(), initial_size.height()))
      .Times(1)
      .RetiresOnSaturation();
  EXPECT_CALL(*gl, StencilFuncSeparate(GL_FRONT, GL_ALWAYS, 0, 0xFFFFFFFFU))
      .Times(1)
      .RetiresOnSaturation();
  EXPECT_CALL(*gl, StencilFuncSeparate(GL_BACK, GL_ALWAYS, 0, 0xFFFFFFFFU))
      .Times(1)
      .RetiresOnSaturation();
  EXPECT_CALL(*gl, StencilMaskSeparate(GL_FRONT, 0xFFFFFFFFU))
      .Times(1)
      .RetiresOnSaturation();
  EXPECT_CALL(*gl, StencilMaskSeparate(GL_BACK, 0xFFFFFFFFU))
      .Times(1)
      .RetiresOnSaturation();
  EXPECT_CALL(*gl, StencilOpSeparate(GL_FRONT, GL_KEEP, GL_KEEP, GL_KEEP))
      .Times(1)
      .RetiresOnSaturation();
  EXPECT_CALL(*gl, StencilOpSeparate(GL_BACK, GL_KEEP, GL_KEEP, GL_KEEP))
      .Times(1)
      .RetiresOnSaturation();
  EXPECT_CALL(*gl, Viewport(0, 0, initial_size.width(), initial_size.height()))
      .Times(1)
      .RetiresOnSaturation();
  SetupInitStateManualExpectations(gl, feature_info);
}
#endif  // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_TEST_HELPERS_AUTOGEN_H_