tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

Query.cpp (2035B)


      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.cpp: Implements the gl::Query class
      8 
      9 #include "libANGLE/Query.h"
     10 
     11 #include "libANGLE/renderer/GLImplFactory.h"
     12 #include "libANGLE/renderer/QueryImpl.h"
     13 
     14 namespace gl
     15 {
     16 Query::Query(rx::GLImplFactory *factory, QueryType type, QueryID id)
     17    : RefCountObject(factory->generateSerial(), id), mQuery(factory->createQuery(type)), mLabel()
     18 {}
     19 
     20 Query::~Query()
     21 {
     22    SafeDelete(mQuery);
     23 }
     24 
     25 void Query::onDestroy(const Context *context)
     26 {
     27    ASSERT(mQuery);
     28    mQuery->onDestroy(context);
     29 }
     30 
     31 angle::Result Query::setLabel(const Context *context, const std::string &label)
     32 {
     33    mLabel = label;
     34 
     35    if (mQuery)
     36    {
     37        return mQuery->onLabelUpdate(context);
     38    }
     39    return angle::Result::Continue;
     40 }
     41 
     42 const std::string &Query::getLabel() const
     43 {
     44    return mLabel;
     45 }
     46 
     47 angle::Result Query::begin(const Context *context)
     48 {
     49    return mQuery->begin(context);
     50 }
     51 
     52 angle::Result Query::end(const Context *context)
     53 {
     54    return mQuery->end(context);
     55 }
     56 
     57 angle::Result Query::queryCounter(const Context *context)
     58 {
     59    return mQuery->queryCounter(context);
     60 }
     61 
     62 angle::Result Query::getResult(const Context *context, GLint *params)
     63 {
     64    return mQuery->getResult(context, params);
     65 }
     66 
     67 angle::Result Query::getResult(const Context *context, GLuint *params)
     68 {
     69    return mQuery->getResult(context, params);
     70 }
     71 
     72 angle::Result Query::getResult(const Context *context, GLint64 *params)
     73 {
     74    return mQuery->getResult(context, params);
     75 }
     76 
     77 angle::Result Query::getResult(const Context *context, GLuint64 *params)
     78 {
     79    return mQuery->getResult(context, params);
     80 }
     81 
     82 angle::Result Query::isResultAvailable(const Context *context, bool *available)
     83 {
     84    return mQuery->isResultAvailable(context, available);
     85 }
     86 
     87 QueryType Query::getType() const
     88 {
     89    return mQuery->getType();
     90 }
     91 
     92 rx::QueryImpl *Query::getImplementation() const
     93 {
     94    return mQuery;
     95 }
     96 }  // namespace gl