Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit d205ee3

Browse files
null77Commit Bot
authored andcommitted
Pass GLImplFactory to Query constructor.
This makes the code more consistent and allows for the Query constructor to generate a Serial. Bug: angleproject:4223 Change-Id: I6cc683b11ed364f13d303f97aa0984e63260953e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1969061 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
1 parent 545c614 commit d205ee3

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

src/libANGLE/Context.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1355,7 +1355,7 @@ Query *Context::getQuery(QueryID handle, bool create, QueryType type)
13551355
if (!query && create)
13561356
{
13571357
ASSERT(type != QueryType::InvalidEnum);
1358-
query = new Query(mImplementation->createQuery(type), handle);
1358+
query = new Query(mImplementation.get(), type, handle);
13591359
query->addRef();
13601360
mQueryMap.assign(handle, query);
13611361
}

src/libANGLE/Query.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,15 @@
77
// Query.cpp: Implements the gl::Query class
88

99
#include "libANGLE/Query.h"
10+
11+
#include "libANGLE/renderer/GLImplFactory.h"
1012
#include "libANGLE/renderer/QueryImpl.h"
1113

1214
namespace gl
1315
{
14-
Query::Query(rx::QueryImpl *impl, QueryID id) : RefCountObject(id), mQuery(impl), mLabel() {}
16+
Query::Query(rx::GLImplFactory *factory, QueryType type, QueryID id)
17+
: RefCountObject(id), mQuery(factory->createQuery(type)), mLabel()
18+
{}
1519

1620
Query::~Query()
1721
{

src/libANGLE/Query.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,17 @@
2020

2121
namespace rx
2222
{
23+
class GLImplFactory;
2324
class QueryImpl;
24-
}
25+
} // namespace rx
2526

2627
namespace gl
2728
{
2829

2930
class Query final : public RefCountObject<QueryID>, public LabeledObject
3031
{
3132
public:
32-
Query(rx::QueryImpl *impl, QueryID id);
33+
Query(rx::GLImplFactory *factory, QueryType type, QueryID id);
3334
~Query() override;
3435
void onDestroy(const Context *context) override;
3536

0 commit comments

Comments
 (0)