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

Side by Side Diff: cc/output/shader_unittest.cc

Issue 12665005: cc: Use highp precision for texture coords if available and needed (Closed) Base URL: http://git.chromium.org/chromium/src.git@highp2
Patch Set: rebase after all dependencies landed Created 7 years, 8 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 unified diff | Download patch
« no previous file with comments | « cc/output/shader.cc ('k') | cc/output/software_renderer_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "cc/output/shader.h"
6
7 #include "cc/debug/fake_web_graphics_context_3d.h"
8 #include "testing/gtest/include/gtest/gtest.h"
9 #include "ui/gfx/point.h"
10 #include "ui/gfx/size.h"
11
12 namespace cc {
13
14 TEST(ShaderTest, HighpThresholds) {
15 // The FakeWebGraphicsContext3D always uses a mediump precision of 10 bits
16 // which corresponds to a native highp threshold of 2^10 = 1024
17 FakeWebGraphicsContext3D context;
18
19 int threshold_min;
20 gfx::Point closePoint(512, 512);
21 gfx::Size smallSize(512, 512);
22 gfx::Point farPoint(2560, 2560);
23 gfx::Size bigSize(2560, 2560);
24
25 threshold_min = 0;
26 EXPECT_EQ(TexCoordPrecisionMedium,
27 TexCoordPrecisionRequired(&context, threshold_min, closePoint));
28 EXPECT_EQ(TexCoordPrecisionMedium,
29 TexCoordPrecisionRequired(&context, threshold_min, smallSize));
30 EXPECT_EQ(TexCoordPrecisionHigh,
31 TexCoordPrecisionRequired(&context, threshold_min, farPoint));
32 EXPECT_EQ(TexCoordPrecisionHigh,
33 TexCoordPrecisionRequired(&context, threshold_min, bigSize));
34
35 threshold_min = 3000;
36 EXPECT_EQ(TexCoordPrecisionMedium,
37 TexCoordPrecisionRequired(&context, threshold_min, closePoint));
38 EXPECT_EQ(TexCoordPrecisionMedium,
39 TexCoordPrecisionRequired(&context, threshold_min, smallSize));
40 EXPECT_EQ(TexCoordPrecisionMedium,
41 TexCoordPrecisionRequired(&context, threshold_min, farPoint));
42 EXPECT_EQ(TexCoordPrecisionMedium,
43 TexCoordPrecisionRequired(&context, threshold_min, bigSize));
44 }
45
46 }
OLDNEW
« no previous file with comments | « cc/output/shader.cc ('k') | cc/output/software_renderer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698