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 GLImplFactory; 24 class QueryImpl; 25 } // namespace rx 26 27 namespace gl 28 { 29 30 class Query final : public RefCountObject<QueryID>, public LabeledObject 31 { 32 public: 33 Query(rx::GLImplFactory *factory, QueryType type, QueryID id); 34 ~Query() override; 35 void onDestroy(const Context *context) override; 36 37 void setLabel(const Context *context, const std::string &label) override; 38 const std::string &getLabel() const override; 39 40 angle::Result begin(const Context *context); 41 angle::Result end(const Context *context); 42 angle::Result queryCounter(const Context *context); 43 angle::Result getResult(const Context *context, GLint *params); 44 angle::Result getResult(const Context *context, GLuint *params); 45 angle::Result getResult(const Context *context, GLint64 *params); 46 angle::Result getResult(const Context *context, GLuint64 *params); 47 angle::Result isResultAvailable(const Context *context, bool *available); 48 49 QueryType getType() const; 50 51 rx::QueryImpl *getImplementation() const; 52 53 private: 54 rx::QueryImpl *mQuery; 55 56 std::string mLabel; 57 }; 58 } // namespace gl 59 60 #endif // LIBANGLE_QUERY_H_ 61