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

Side by Side Diff: tests/ImageTest.cpp

Issue 2337803002: Don't copy image buffer when calculating size.
Patch Set: Removing debug info. Created 4 years, 3 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/SkImage_Gpu.cpp ('k') | no next file » | 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 2015 Google Inc. 2 * Copyright 2015 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 #include <functional> 8 #include <functional>
9 #include <initializer_list> 9 #include <initializer_list>
10 #include <vector> 10 #include <vector>
(...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after
888 int fExpectedScaleFact or; 888 int fExpectedScaleFact or;
889 bool fExpectation; 889 bool fExpectation;
890 } testCases[] = { 890 } testCases[] = {
891 { create_image, {{SkMatrix::I(), kNone_SkFilterQuality, 0}}, 891 { create_image, {{SkMatrix::I(), kNone_SkFilterQuality, 0}},
892 kNone_SkFilterQuality, 1, true }, 892 kNone_SkFilterQuality, 1, true },
893 { create_codec_image, {{SkMatrix::I(), kNone_SkFilterQuality, 0}}, 893 { create_codec_image, {{SkMatrix::I(), kNone_SkFilterQuality, 0}},
894 kNone_SkFilterQuality, 1, true }, 894 kNone_SkFilterQuality, 1, true },
895 { create_data_image, {{SkMatrix::I(), kNone_SkFilterQuality, 0}}, 895 { create_data_image, {{SkMatrix::I(), kNone_SkFilterQuality, 0}},
896 kNone_SkFilterQuality, 1, true }, 896 kNone_SkFilterQuality, 1, true },
897 { create_picture_image, {{SkMatrix::I(), kNone_SkFilterQuality, 0}}, 897 { create_picture_image, {{SkMatrix::I(), kNone_SkFilterQuality, 0}},
898 kNone_SkFilterQuality, 1, false }, 898 kNone_SkFilterQuality, 1, true },
cblume 2016/09/16 08:10:45 I am not yet familiar with the cacherator but as I
bsalomon 2016/09/16 13:23:49 We definitely don't want this one to succeed. It w
899 { [context] { return create_gpu_image(context); }, 899 { [context] { return create_gpu_image(context); },
900 {{SkMatrix::I(), kNone_SkFilterQuality, 0}}, 900 {{SkMatrix::I(), kNone_SkFilterQuality, 0}},
901 kNone_SkFilterQuality, 1, false }, 901 kNone_SkFilterQuality, 1, false },
902 // Create a texture image in a another GrContext. 902 // Create a texture image in a another GrContext.
903 { [testContext, otherContextInfo] { 903 { [testContext, otherContextInfo] {
904 otherContextInfo.testContext()->makeCurrent(); 904 otherContextInfo.testContext()->makeCurrent();
905 sk_sp<SkImage> otherContextImage = create_gpu_image(otherContextInfo .grContext()); 905 sk_sp<SkImage> otherContextImage = create_gpu_image(otherContextInfo .grContext());
906 testContext->makeCurrent(); 906 testContext->makeCurrent();
907 return otherContextImage; 907 return otherContextImage;
908 }, {{SkMatrix::I(), kNone_SkFilterQuality, 0}}, 908 }, {{SkMatrix::I(), kNone_SkFilterQuality, 0}},
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
1023 SkBitmap bm1; 1023 SkBitmap bm1;
1024 bm1.allocPixels(SkImageInfo::MakeN32(256, 256, kUnpremul_SkAlphaType)); 1024 bm1.allocPixels(SkImageInfo::MakeN32(256, 256, kUnpremul_SkAlphaType));
1025 bm0.readPixels(bm1.info(), bm1.getPixels(), bm1.rowBytes(), 0, 0); 1025 bm0.readPixels(bm1.info(), bm1.getPixels(), bm1.rowBytes(), 0, 0);
1026 1026
1027 SkBitmap bm2; 1027 SkBitmap bm2;
1028 bm2.allocPixels(SkImageInfo::MakeN32(256, 256, kPremul_SkAlphaType)); 1028 bm2.allocPixels(SkImageInfo::MakeN32(256, 256, kPremul_SkAlphaType));
1029 bm1.readPixels(bm2.info(), bm2.getPixels(), bm2.rowBytes(), 0, 0); 1029 bm1.readPixels(bm2.info(), bm2.getPixels(), bm2.rowBytes(), 0, 0);
1030 1030
1031 REPORTER_ASSERT(reporter, equal(bm0, bm2)); 1031 REPORTER_ASSERT(reporter, equal(bm0, bm2));
1032 } 1032 }
OLDNEW
« 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