• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // Copyright 2012 The ANGLE Project Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
5 //
6 
7 // Query.h: Defines the gl::Query class
8 
9 #ifndef LIBANGLE_QUERY_H_
10 #define LIBANGLE_QUERY_H_
11 
12 #include "common/PackedEnums.h"
13 #include "libANGLE/Debug.h"
14 #include "libANGLE/Error.h"
15 #include "libANGLE/RefCountObject.h"
16 
17 #include "common/angleutils.h"
18 
19 #include "angle_gl.h"
20 
21 namespace rx
22 {
23 class QueryImpl;
24 }
25 
26 namespace gl
27 {
28 
29 class Query final : public RefCountObject, public LabeledObject
30 {
31   public:
32     Query(rx::QueryImpl *impl, GLuint id);
33     ~Query() override;
34     void onDestroy(const Context *context) override;
35 
36     void setLabel(const Context *context, const std::string &label) override;
37     const std::string &getLabel() const override;
38 
39     angle::Result begin(const Context *context);
40     angle::Result end(const Context *context);
41     angle::Result queryCounter(const Context *context);
42     angle::Result getResult(const Context *context, GLint *params);
43     angle::Result getResult(const Context *context, GLuint *params);
44     angle::Result getResult(const Context *context, GLint64 *params);
45     angle::Result getResult(const Context *context, GLuint64 *params);
46     angle::Result isResultAvailable(const Context *context, bool *available);
47 
48     QueryType getType() const;
49 
50     rx::QueryImpl *getImplementation() const;
51 
52   private:
53     rx::QueryImpl *mQuery;
54 
55     std::string mLabel;
56 };
57 }  // namespace gl
58 
59 #endif  // LIBANGLE_QUERY_H_
60