Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(196)

Unified Diff: gpu/command_buffer/service/gpu_tracer_unittest.cc

Issue 1998723002: Move code in ui/gl/* from gfx:: to gl:: (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/command_buffer/service/gpu_tracer.cc ('k') | gpu/command_buffer/service/in_process_command_buffer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/gpu_tracer_unittest.cc
diff --git a/gpu/command_buffer/service/gpu_tracer_unittest.cc b/gpu/command_buffer/service/gpu_tracer_unittest.cc
index 161507420aa1a0012bee0c2329948a0e7c549659..06e48561f453892577f1c20b81e2ecbc8cb55fc8 100644
--- a/gpu/command_buffer/service/gpu_tracer_unittest.cc
+++ b/gpu/command_buffer/service/gpu_tracer_unittest.cc
@@ -86,22 +86,21 @@ class GPUTracerTester : public GPUTracer {
class BaseGpuTest : public GpuServiceTest {
public:
- explicit BaseGpuTest(gfx::GPUTiming::TimerType test_timer_type)
- : test_timer_type_(test_timer_type) {
- }
+ explicit BaseGpuTest(gl::GPUTiming::TimerType test_timer_type)
+ : test_timer_type_(test_timer_type) {}
protected:
void SetUp() override {
g_fakeCPUTime = 0;
const char* gl_version = "3.2";
const char* extensions = "";
- if (GetTimerType() == gfx::GPUTiming::kTimerTypeEXT) {
+ if (GetTimerType() == gl::GPUTiming::kTimerTypeEXT) {
gl_version = "2.1";
extensions = "GL_EXT_timer_query";
- } else if (GetTimerType() == gfx::GPUTiming::kTimerTypeDisjoint) {
+ } else if (GetTimerType() == gl::GPUTiming::kTimerTypeDisjoint) {
gl_version = "opengl es 3.0";
extensions = "GL_EXT_disjoint_timer_query";
- } else if (GetTimerType() == gfx::GPUTiming::kTimerTypeARB) {
+ } else if (GetTimerType() == gl::GPUTiming::kTimerTypeARB) {
// TODO(sievers): The tracer should not depend on ARB_occlusion_query.
// Try merge Query APIs (core, ARB, EXT) into a single binding each.
extensions = "GL_ARB_timer_query GL_ARB_occlusion_query";
@@ -109,7 +108,7 @@ class BaseGpuTest : public GpuServiceTest {
GpuServiceTest::SetUpWithGLVersion(gl_version, extensions);
// Disjoint check should only be called by kTracerTypeDisjointTimer type.
- if (GetTimerType() == gfx::GPUTiming::kTimerTypeDisjoint)
+ if (GetTimerType() == gl::GPUTiming::kTimerTypeDisjoint)
gl_fake_queries_.ExpectDisjointCalls(*gl_);
else
gl_fake_queries_.ExpectNoDisjointCalls(*gl_);
@@ -132,7 +131,7 @@ class BaseGpuTest : public GpuServiceTest {
void ExpectTraceQueryMocks() {
if (gpu_timing_client_->IsAvailable()) {
// Delegate query APIs used by GPUTrace to a GlFakeQueries
- const bool elapsed = (GetTimerType() == gfx::GPUTiming::kTimerTypeEXT);
+ const bool elapsed = (GetTimerType() == gl::GPUTiming::kTimerTypeEXT);
gl_fake_queries_.ExpectGPUTimerQuery(*gl_, elapsed);
}
}
@@ -203,26 +202,26 @@ class BaseGpuTest : public GpuServiceTest {
}
void ExpectTracerOffsetQueryMocks() {
- if (GetTimerType() != gfx::GPUTiming::kTimerTypeARB) {
+ if (GetTimerType() != gl::GPUTiming::kTimerTypeARB) {
gl_fake_queries_.ExpectNoOffsetCalculationQuery(*gl_);
} else {
gl_fake_queries_.ExpectOffsetCalculationQuery(*gl_);
}
}
- gfx::GPUTiming::TimerType GetTimerType() { return test_timer_type_; }
+ gl::GPUTiming::TimerType GetTimerType() { return test_timer_type_; }
- gfx::GPUTiming::TimerType test_timer_type_;
- gfx::GPUTimingFake gl_fake_queries_;
+ gl::GPUTiming::TimerType test_timer_type_;
+ gl::GPUTimingFake gl_fake_queries_;
- scoped_refptr<gfx::GPUTimingClient> gpu_timing_client_;
+ scoped_refptr<gl::GPUTimingClient> gpu_timing_client_;
scoped_refptr<MockOutputter> outputter_ref_;
};
// Test GPUTrace calls all the correct gl calls.
class BaseGpuTraceTest : public BaseGpuTest {
public:
- explicit BaseGpuTraceTest(gfx::GPUTiming::TimerType test_timer_type)
+ explicit BaseGpuTraceTest(gl::GPUTiming::TimerType test_timer_type)
: BaseGpuTest(test_timer_type) {}
void DoTraceTest(bool tracing_service, bool tracing_device) {
@@ -286,13 +285,13 @@ class BaseGpuTraceTest : public BaseGpuTest {
class GpuARBTimerTraceTest : public BaseGpuTraceTest {
public:
- GpuARBTimerTraceTest() : BaseGpuTraceTest(gfx::GPUTiming::kTimerTypeARB) {}
+ GpuARBTimerTraceTest() : BaseGpuTraceTest(gl::GPUTiming::kTimerTypeARB) {}
};
class GpuDisjointTimerTraceTest : public BaseGpuTraceTest {
public:
GpuDisjointTimerTraceTest()
- : BaseGpuTraceTest(gfx::GPUTiming::kTimerTypeDisjoint) {}
+ : BaseGpuTraceTest(gl::GPUTiming::kTimerTypeDisjoint) {}
};
TEST_F(GpuARBTimerTraceTest, ARBTimerTraceTestOff) {
@@ -330,7 +329,7 @@ TEST_F(GpuDisjointTimerTraceTest, DisjointTimerTraceTestBothOn) {
// Test GPUTracer calls all the correct gl calls.
class BaseGpuTracerTest : public BaseGpuTest {
public:
- explicit BaseGpuTracerTest(gfx::GPUTiming::TimerType test_timer_type)
+ explicit BaseGpuTracerTest(gl::GPUTiming::TimerType test_timer_type)
: BaseGpuTest(test_timer_type) {}
void DoBasicTracerTest() {
@@ -556,7 +555,7 @@ class BaseGpuTracerTest : public BaseGpuTest {
// Create GPUTimingClient to make sure disjoint value is correct. This
// should not interfere with the tracer's disjoint value.
- scoped_refptr<gfx::GPUTimingClient> disjoint_client =
+ scoped_refptr<gl::GPUTimingClient> disjoint_client =
GetGLContext()->CreateGPUTimingClient();
// We assert here based on the disjoint_client because if disjoints are not
@@ -638,24 +637,23 @@ class BaseGpuTracerTest : public BaseGpuTest {
class InvalidTimerTracerTest : public BaseGpuTracerTest {
public:
InvalidTimerTracerTest()
- : BaseGpuTracerTest(gfx::GPUTiming::kTimerTypeInvalid) {}
+ : BaseGpuTracerTest(gl::GPUTiming::kTimerTypeInvalid) {}
};
class GpuEXTTimerTracerTest : public BaseGpuTracerTest {
public:
- GpuEXTTimerTracerTest() : BaseGpuTracerTest(gfx::GPUTiming::kTimerTypeEXT) {}
+ GpuEXTTimerTracerTest() : BaseGpuTracerTest(gl::GPUTiming::kTimerTypeEXT) {}
};
class GpuARBTimerTracerTest : public BaseGpuTracerTest {
public:
- GpuARBTimerTracerTest()
- : BaseGpuTracerTest(gfx::GPUTiming::kTimerTypeARB) {}
+ GpuARBTimerTracerTest() : BaseGpuTracerTest(gl::GPUTiming::kTimerTypeARB) {}
};
class GpuDisjointTimerTracerTest : public BaseGpuTracerTest {
public:
GpuDisjointTimerTracerTest()
- : BaseGpuTracerTest(gfx::GPUTiming::kTimerTypeDisjoint) {}
+ : BaseGpuTracerTest(gl::GPUTiming::kTimerTypeDisjoint) {}
};
TEST_F(InvalidTimerTracerTest, InvalidTimerBasicTracerTest) {
@@ -778,9 +776,9 @@ TEST_F(GPUTracerTest, TraceDuringDecodeTest) {
}
TEST_F(GpuDisjointTimerTracerTest, MultipleClientsDisjointTest) {
- scoped_refptr<gfx::GPUTimingClient> client1 =
+ scoped_refptr<gl::GPUTimingClient> client1 =
GetGLContext()->CreateGPUTimingClient();
- scoped_refptr<gfx::GPUTimingClient> client2 =
+ scoped_refptr<gl::GPUTimingClient> client2 =
GetGLContext()->CreateGPUTimingClient();
// Test both clients are initialized as no errors.
@@ -801,7 +799,7 @@ TEST_F(GpuDisjointTimerTracerTest, MultipleClientsDisjointTest) {
gl_fake_queries_.SetDisjoint();
// Test new client disjoint value is cleared.
- scoped_refptr<gfx::GPUTimingClient> client3 =
+ scoped_refptr<gl::GPUTimingClient> client3 =
GetGLContext()->CreateGPUTimingClient();
ASSERT_TRUE(client1->CheckAndResetTimerErrors());
ASSERT_TRUE(client2->CheckAndResetTimerErrors());
« no previous file with comments | « gpu/command_buffer/service/gpu_tracer.cc ('k') | gpu/command_buffer/service/in_process_command_buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698