content/canvas/src/WebGLQuery.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
     2 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 #ifndef WEBGLQUERY_H_
     7 #define WEBGLQUERY_H_
     9 #include "WebGLObjectModel.h"
    11 #include "nsWrapperCache.h"
    13 #include "mozilla/LinkedList.h"
    15 namespace mozilla {
    17 class WebGLQuery MOZ_FINAL
    18     : public nsWrapperCache
    19     , public WebGLRefCountedObject<WebGLQuery>
    20     , public LinkedListElement<WebGLQuery>
    21     , public WebGLContextBoundObject
    22 {
    23 // -----------------------------------------------------------------------------
    24 // PUBLIC
    25 public:
    27     // -------------------------------------------------------------------------
    28     // CONSTRUCTOR & DESTRUCTOR
    30     WebGLQuery(WebGLContext *context);
    32     ~WebGLQuery() {
    33         DeleteOnce();
    34     };
    37     // -------------------------------------------------------------------------
    38     // MEMBER FUNCTIONS
    40     bool IsActive() const;
    42     bool HasEverBeenActive()
    43     {
    44         return mType != 0;
    45     }
    48     // -------------------------------------------------------------------------
    49     // IMPLEMENT WebGLRefCountedObject and WebGLContextBoundObject
    51     void Delete();
    53     WebGLContext* GetParentObject() const
    54     {
    55         return Context();
    56     }
    59     // -------------------------------------------------------------------------
    60     // IMPLEMENT NS
    61     virtual JSObject* WrapObject(JSContext *cx) MOZ_OVERRIDE;
    63     NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLQuery)
    64     NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLQuery)
    67 // -----------------------------------------------------------------------------
    68 // PRIVATE
    69 private:
    71     // -------------------------------------------------------------------------
    72     // MEMBERS
    73     GLuint mGLName;
    74     GLenum mType;
    76     // -------------------------------------------------------------------------
    77     // FRIENDSHIPS
    78     friend class WebGLContext;
    79 };
    81 } // namespace mozilla
    83 #endif

mercurial