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

Unified Diff: cc/output/shader_unittest.cc

Issue 93433004: Use GLES2Interface for shaders and programs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix android_aosp warning Created 7 years 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 | « cc/output/shader.cc ('k') | cc/test/test_context_provider.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/shader_unittest.cc
diff --git a/cc/output/shader_unittest.cc b/cc/output/shader_unittest.cc
index a608d93bc13d78d9bde56aeac3d941dbc43aeb29..4aacbf7180fddc090c3e867a83ad088c00a3cb0e 100644
--- a/cc/output/shader_unittest.cc
+++ b/cc/output/shader_unittest.cc
@@ -4,7 +4,8 @@
#include "cc/output/shader.h"
-#include "cc/test/fake_web_graphics_context_3d.h"
+#include "cc/test/test_gles2_interface.h"
+#include "cc/test/test_web_graphics_context_3d.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/point.h"
#include "ui/gfx/size.h"
@@ -12,9 +13,11 @@
namespace cc {
TEST(ShaderTest, HighpThresholds) {
- // The FakeWebGraphicsContext3D always uses a mediump precision of 10 bits
- // which corresponds to a native highp threshold of 2^10 = 1024
- FakeWebGraphicsContext3D context;
+ // The test context always uses a mediump precision of 10 bits which
+ // corresponds to a native highp threshold of 2^10 = 1024
+ scoped_ptr<TestWebGraphicsContext3D> stub_context =
+ TestWebGraphicsContext3D::Create();
+ TestGLES2Interface stub_gl(stub_context.get());
int threshold_cache = 0;
int threshold_min;
@@ -25,23 +28,23 @@ TEST(ShaderTest, HighpThresholds) {
threshold_min = 0;
EXPECT_EQ(TexCoordPrecisionMedium, TexCoordPrecisionRequired(
- &context, &threshold_cache, threshold_min, closePoint));
+ &stub_gl, &threshold_cache, threshold_min, closePoint));
EXPECT_EQ(TexCoordPrecisionMedium, TexCoordPrecisionRequired(
- &context, &threshold_cache, threshold_min, smallSize));
+ &stub_gl, &threshold_cache, threshold_min, smallSize));
EXPECT_EQ(TexCoordPrecisionHigh, TexCoordPrecisionRequired(
- &context, &threshold_cache, threshold_min, farPoint));
+ &stub_gl, &threshold_cache, threshold_min, farPoint));
EXPECT_EQ(TexCoordPrecisionHigh, TexCoordPrecisionRequired(
- &context, &threshold_cache, threshold_min, bigSize));
+ &stub_gl, &threshold_cache, threshold_min, bigSize));
threshold_min = 3000;
EXPECT_EQ(TexCoordPrecisionMedium, TexCoordPrecisionRequired(
- &context, &threshold_cache, threshold_min, closePoint));
+ &stub_gl, &threshold_cache, threshold_min, closePoint));
EXPECT_EQ(TexCoordPrecisionMedium, TexCoordPrecisionRequired(
- &context, &threshold_cache, threshold_min, smallSize));
+ &stub_gl, &threshold_cache, threshold_min, smallSize));
EXPECT_EQ(TexCoordPrecisionMedium, TexCoordPrecisionRequired(
- &context, &threshold_cache, threshold_min, farPoint));
+ &stub_gl, &threshold_cache, threshold_min, farPoint));
EXPECT_EQ(TexCoordPrecisionMedium, TexCoordPrecisionRequired(
- &context, &threshold_cache, threshold_min, bigSize));
+ &stub_gl, &threshold_cache, threshold_min, bigSize));
}
} // namespace cc
« no previous file with comments | « cc/output/shader.cc ('k') | cc/test/test_context_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698