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

Unified Diff: third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp

Issue 2483243003: Re-enable image_decode_bench target (Closed)
Patch Set: Re-enable image_decode_bench target Created 4 years, 1 month 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
Index: third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp
diff --git a/third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp b/third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp
index 8aa6b4a00b523327313f82aed2798e377cf63bf4..b170e7b08c922382d235122ea58c9461be27f99b 100644
--- a/third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp
+++ b/third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp
@@ -258,11 +258,10 @@ PassRefPtr<SharedBuffer> readFile(const char* fileName) {
bool decodeImageData(SharedBuffer* data,
bool colorCorrection,
size_t packetSize) {
- std::unique_ptr<ImageDecoder> decoder = ImageDecoder::create(
- *data, ImageDecoder::AlphaPremultiplied,
- colorCorrection ? ImageDecoder::GammaAndColorProfileApplied
- : ImageDecoder::GammaAndColorProfileIgnored);
-
+ std::unique_ptr<ImageDecoder> decoder =
+ ImageDecoder::create(data, true, ImageDecoder::AlphaPremultiplied,
+ colorCorrection ? ImageDecoder::ColorSpaceApplied
+ : ImageDecoder::ColorSpaceIgnored);
if (!packetSize) {
bool allDataReceived = true;
decoder->setData(data, allDataReceived);
@@ -309,8 +308,12 @@ int main(int argc, char* argv[]) {
bool applyColorCorrection = false;
- if (argc >= 2 && strcmp(argv[1], "--color-correct") == 0)
+ if (argc >= 2 && strcmp(argv[1], "--color-correct") == 0) {
applyColorCorrection = (--argc, ++argv, true);
+ WebVector<char> profile;
+ getScreenColorProfile(&profile); // Returns a color spin color profile.
+ ImageDecoder::setTargetColorProfile(profile);
+ }
if (argc < 2) {
fprintf(stderr,
@@ -348,14 +351,10 @@ int main(int argc, char* argv[]) {
}
}
- // Create a web platform without V8.
+ // Create a web platform. blink::Platform can't be used directly because its
+ // constructor is protected.
- class WebPlatform : public blink::Platform {
- public:
- void screenColorProfile(WebVector<char>* profile) override {
- getScreenColorProfile(profile); // Returns a color spin color profile.
- }
- };
+ class WebPlatform : public blink::Platform {};
Platform::initialize(new WebPlatform());
« third_party/WebKit/Source/platform/BUILD.gn ('K') | « third_party/WebKit/Source/platform/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698