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

Unified Diff: tests/ImageTest.cpp

Issue 2242883004: Store mipmap levels in deferred texture image (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fixing opening brace location. Created 4 years, 4 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 | « src/image/SkImage_Gpu.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/ImageTest.cpp
diff --git a/tests/ImageTest.cpp b/tests/ImageTest.cpp
index fa22641d9e222ebe5765146f143f9e7ddafdfaba..e53d14222c7273a66c50afd512c6a7a2760fb21c 100644
--- a/tests/ImageTest.cpp
+++ b/tests/ImageTest.cpp
@@ -888,20 +888,28 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(DeferredTextureImage, reporter, ctxInfo) {
int fExpectedScaleFactor;
bool fExpectation;
} testCases[] = {
- { create_image, {{}}, kNone_SkFilterQuality, 1, true },
- { create_codec_image, {{}}, kNone_SkFilterQuality, 1, true },
- { create_data_image, {{}}, kNone_SkFilterQuality, 1, true },
- { create_picture_image, {{}}, kNone_SkFilterQuality, 1, false },
- { [context] { return create_gpu_image(context); }, {{}}, kNone_SkFilterQuality, 1, false },
+ { create_image, {{SkMatrix::I(), kNone_SkFilterQuality, 0}},
+ kNone_SkFilterQuality, 1, true },
+ { create_codec_image, {{SkMatrix::I(), kNone_SkFilterQuality, 0}},
+ kNone_SkFilterQuality, 1, true },
+ { create_data_image, {{SkMatrix::I(), kNone_SkFilterQuality, 0}},
+ kNone_SkFilterQuality, 1, true },
+ { create_picture_image, {{SkMatrix::I(), kNone_SkFilterQuality, 0}},
+ kNone_SkFilterQuality, 1, false },
+ { [context] { return create_gpu_image(context); },
+ {{SkMatrix::I(), kNone_SkFilterQuality, 0}},
+ kNone_SkFilterQuality, 1, false },
// Create a texture image in a another GrContext.
{ [testContext, otherContextInfo] {
otherContextInfo.testContext()->makeCurrent();
sk_sp<SkImage> otherContextImage = create_gpu_image(otherContextInfo.grContext());
testContext->makeCurrent();
return otherContextImage;
- }, {{}}, kNone_SkFilterQuality, 1, false },
+ }, {{SkMatrix::I(), kNone_SkFilterQuality, 0}},
+ kNone_SkFilterQuality, 1, false },
// Create an image that is too large to upload.
- { create_image_large, {{}}, kNone_SkFilterQuality, 1, false },
+ { create_image_large, {{SkMatrix::I(), kNone_SkFilterQuality, 0}},
+ kNone_SkFilterQuality, 1, false },
// Create an image that is too large, but is scaled to an acceptable size.
{ create_image_large, {{SkMatrix::I(), kMedium_SkFilterQuality, 4}},
kMedium_SkFilterQuality, 16, true},
@@ -920,8 +928,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(DeferredTextureImage, reporter, ctxInfo) {
sk_sp<SkImage> image(testCase.fImageFactory());
size_t size = image->getDeferredTextureImageData(*proxy, testCase.fParams.data(),
static_cast<int>(testCase.fParams.size()),
- nullptr);
-
+ nullptr, SkSourceGammaTreatment::kIgnore);
static const char *const kFS[] = { "fail", "succeed" };
if (SkToBool(size) != testCase.fExpectation) {
ERRORF(reporter, "This image was expected to %s but did not.",
@@ -932,12 +939,12 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(DeferredTextureImage, reporter, ctxInfo) {
void* misaligned = reinterpret_cast<void*>(reinterpret_cast<intptr_t>(buffer) + 3);
if (image->getDeferredTextureImageData(*proxy, testCase.fParams.data(),
static_cast<int>(testCase.fParams.size()),
- misaligned)) {
+ misaligned, SkSourceGammaTreatment::kIgnore)) {
ERRORF(reporter, "Should fail when buffer is misaligned.");
}
if (!image->getDeferredTextureImageData(*proxy, testCase.fParams.data(),
static_cast<int>(testCase.fParams.size()),
- buffer)) {
+ buffer, SkSourceGammaTreatment::kIgnore)) {
ERRORF(reporter, "deferred image size succeeded but creation failed.");
} else {
for (auto budgeted : { SkBudgeted::kNo, SkBudgeted::kYes }) {
« no previous file with comments | « src/image/SkImage_Gpu.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698