|
1 #include "precompiled.h" |
|
2 // |
|
3 // Copyright (c) 2012 The ANGLE Project Authors. All rights reserved. |
|
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 // Query.cpp: Implements the gl::Query class |
|
9 |
|
10 #include "libGLESv2/Query.h" |
|
11 #include "libGLESv2/renderer/QueryImpl.h" |
|
12 #include "libGLESv2/renderer/Renderer.h" |
|
13 |
|
14 namespace gl |
|
15 { |
|
16 |
|
17 Query::Query(rx::Renderer *renderer, GLenum type, GLuint id) : RefCountObject(id) |
|
18 { |
|
19 mQuery = renderer->createQuery(type); |
|
20 } |
|
21 |
|
22 Query::~Query() |
|
23 { |
|
24 delete mQuery; |
|
25 } |
|
26 |
|
27 void Query::begin() |
|
28 { |
|
29 mQuery->begin(); |
|
30 } |
|
31 |
|
32 void Query::end() |
|
33 { |
|
34 mQuery->end(); |
|
35 } |
|
36 |
|
37 GLuint Query::getResult() |
|
38 { |
|
39 return mQuery->getResult(); |
|
40 } |
|
41 |
|
42 GLboolean Query::isResultAvailable() |
|
43 { |
|
44 return mQuery->isResultAvailable(); |
|
45 } |
|
46 |
|
47 GLenum Query::getType() const |
|
48 { |
|
49 return mQuery->getType(); |
|
50 } |
|
51 |
|
52 } |