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

Side by Side Diff: tests/FloatingPointTextureTest.cpp

Issue 1225923010: Refugee from Dead Machine 4: MDB Monster Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Last update from dead machine 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 unified diff | Download patch
« no previous file with comments | « src/image/SkSurface_Gpu.cpp ('k') | tests/GLProgramsTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 /* 8 /*
9 * This is a straightforward test of floating point textures, which are 9 * This is a straightforward test of floating point textures, which are
10 * supported on some platforms. As of right now, this test only supports 10 * supported on some platforms. As of right now, this test only supports
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 if (nullptr == context) { 58 if (nullptr == context) {
59 continue; 59 continue;
60 } 60 }
61 61
62 SkAutoTUnref<GrTexture> fpTexture(context->textureProvider()->create Texture( 62 SkAutoTUnref<GrTexture> fpTexture(context->textureProvider()->create Texture(
63 desc, false, controlPixelData.begin(), 0)); 63 desc, false, controlPixelData.begin(), 0));
64 // Floating point textures are NOT supported everywhere 64 // Floating point textures are NOT supported everywhere
65 if (nullptr == fpTexture) { 65 if (nullptr == fpTexture) {
66 continue; 66 continue;
67 } 67 }
68
69 fpTexture->setFromRawPixels(true);
70 fpTexture->setException(true);
71
68 fpTexture->readPixels(0, 0, DEV_W, DEV_H, desc.fConfig, readBuffer.b egin(), 0); 72 fpTexture->readPixels(0, 0, DEV_W, DEV_H, desc.fConfig, readBuffer.b egin(), 0);
69 REPORTER_ASSERT(reporter, 73 REPORTER_ASSERT(reporter,
70 0 == memcmp(readBuffer.begin(), controlPixelData.begin(), readBu ffer.bytes())); 74 0 == memcmp(readBuffer.begin(), controlPixelData.begin(), readBu ffer.bytes()));
71 } 75 }
72 } 76 }
73 } 77 }
74 78
75 static const int FP_CONTROL_ARRAY_SIZE = DEV_W * DEV_H * 4/*RGBA*/; 79 static const int FP_CONTROL_ARRAY_SIZE = DEV_W * DEV_H * 4/*RGBA*/;
76 static const float kMaxIntegerRepresentableInSPFloatingPoint = 16777216; // 2 ^ 24 80 static const float kMaxIntegerRepresentableInSPFloatingPoint = 16777216; // 2 ^ 24
77 81
(...skipping 14 matching lines...) Expand all
92 96
93 static const int HALF_RGBA_CONTROL_ARRAY_SIZE = DEV_W * DEV_H * 4 /*RGBA*/; 97 static const int HALF_RGBA_CONTROL_ARRAY_SIZE = DEV_W * DEV_H * 4 /*RGBA*/;
94 98
95 DEF_GPUTEST(HalfFloatRGBATextureTest, reporter, factory) { 99 DEF_GPUTEST(HalfFloatRGBATextureTest, reporter, factory) {
96 runFPTest<SkHalf>(reporter, factory, SK_HalfMin, SK_HalfMax, SK_HalfEpsilon, 100 runFPTest<SkHalf>(reporter, factory, SK_HalfMin, SK_HalfMax, SK_HalfEpsilon,
97 kMaxIntegerRepresentableInHalfFloatingPoint, 101 kMaxIntegerRepresentableInHalfFloatingPoint,
98 HALF_RGBA_CONTROL_ARRAY_SIZE, kRGBA_half_GrPixelConfig); 102 HALF_RGBA_CONTROL_ARRAY_SIZE, kRGBA_half_GrPixelConfig);
99 } 103 }
100 104
101 #endif 105 #endif
OLDNEW
« no previous file with comments | « src/image/SkSurface_Gpu.cpp ('k') | tests/GLProgramsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698