blob: d738eb4ffc7d13946a0854e84219c53aba1eac41 [file] [log] [blame]
shannon.woods@transgaming.combfbec452013-02-28 23:02:34 +00001//
2// Copyright (c) 2013 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// QueryImpl.h: Defines the abstract rx::QueryImpl class.
8
Geoff Lang0a73dd82014-11-19 16:18:08 -05009#ifndef LIBANGLE_RENDERER_QUERYIMPL_H_
10#define LIBANGLE_RENDERER_QUERYIMPL_H_
shannon.woods@transgaming.combfbec452013-02-28 23:02:34 +000011
Geoff Lang2b5420c2014-11-19 14:20:15 -050012#include "libANGLE/Error.h"
Geoff Lang5aad9672014-09-08 11:10:42 -040013
shannon.woods@transgaming.combfbec452013-02-28 23:02:34 +000014#include "common/angleutils.h"
15
Geoff Lang0b7eef72014-06-12 14:10:47 -040016#include <GLES2/gl2.h>
17
shannon.woods@transgaming.combfbec452013-02-28 23:02:34 +000018namespace rx
19{
20
Jamie Madillf0d10f82015-03-31 12:56:52 -040021class QueryImpl : angle::NonCopyable
shannon.woods@transgaming.combfbec452013-02-28 23:02:34 +000022{
23 public:
Shannon Woods97d65b72014-08-05 18:04:22 -040024 explicit QueryImpl(GLenum type) { mType = type; }
shannon.woods@transgaming.combfbec452013-02-28 23:02:34 +000025 virtual ~QueryImpl() { }
26
Geoff Lang5aad9672014-09-08 11:10:42 -040027 virtual gl::Error begin() = 0;
28 virtual gl::Error end() = 0;
Ian Ewell3ffd78b2016-01-22 16:09:42 -050029 virtual gl::Error queryCounter() = 0;
30 virtual gl::Error getResult(GLint *params) = 0;
Geoff Lang5aad9672014-09-08 11:10:42 -040031 virtual gl::Error getResult(GLuint *params) = 0;
Ian Ewell3ffd78b2016-01-22 16:09:42 -050032 virtual gl::Error getResult(GLint64 *params) = 0;
33 virtual gl::Error getResult(GLuint64 *params) = 0;
34 virtual gl::Error isResultAvailable(bool *available) = 0;
shannon.woods@transgaming.combfbec452013-02-28 23:02:34 +000035
Shannon Woods97d65b72014-08-05 18:04:22 -040036 GLenum getType() const { return mType; }
shannon.woods@transgaming.combfbec452013-02-28 23:02:34 +000037
38 private:
shannon.woods@transgaming.combfbec452013-02-28 23:02:34 +000039 GLenum mType;
shannon.woods@transgaming.combfbec452013-02-28 23:02:34 +000040};
41
42}
43
Geoff Lang0a73dd82014-11-19 16:18:08 -050044#endif // LIBANGLE_RENDERER_QUERYIMPL_H_