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

Side by Side Diff: third_party/WebKit/Source/platform/image-decoders/ImageDecoderTest.cpp

Issue 2523943002: Explicitly specify target color space to ImageDecoder at creation (Closed)
Patch Set: Rebase Created 4 years 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 24 matching lines...) Expand all
35 #include "wtf/PtrUtil.h" 35 #include "wtf/PtrUtil.h"
36 #include "wtf/Vector.h" 36 #include "wtf/Vector.h"
37 #include <memory> 37 #include <memory>
38 38
39 namespace blink { 39 namespace blink {
40 40
41 class TestImageDecoder : public ImageDecoder { 41 class TestImageDecoder : public ImageDecoder {
42 public: 42 public:
43 TestImageDecoder() 43 TestImageDecoder()
44 : ImageDecoder(AlphaNotPremultiplied, 44 : ImageDecoder(AlphaNotPremultiplied,
45 ColorSpaceApplied, 45 ColorSpaceTransformed,
46 targetColorSpaceForTesting(),
46 noDecodedImageByteLimit) {} 47 noDecodedImageByteLimit) {}
47 48
48 String filenameExtension() const override { return ""; } 49 String filenameExtension() const override { return ""; }
49 50
50 Vector<ImageFrame, 1>& frameBufferCache() { return m_frameBufferCache; } 51 Vector<ImageFrame, 1>& frameBufferCache() { return m_frameBufferCache; }
51 52
52 void resetRequiredPreviousFrames(bool knownOpaque = false) { 53 void resetRequiredPreviousFrames(bool knownOpaque = false) {
53 for (size_t i = 0; i < m_frameBufferCache.size(); ++i) 54 for (size_t i = 0; i < m_frameBufferCache.size(); ++i)
54 m_frameBufferCache[i].setRequiredPreviousFrameIndex( 55 m_frameBufferCache[i].setRequiredPreviousFrameIndex(
55 findRequiredPreviousFrame(i, knownOpaque)); 56 findRequiredPreviousFrame(i, knownOpaque));
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 for (size_t i = 0; i < numFrames; ++i) { 246 for (size_t i = 0; i < numFrames; ++i) {
246 SCOPED_TRACE(testing::Message() << i); 247 SCOPED_TRACE(testing::Message() << i);
247 if (i == 5) 248 if (i == 5)
248 EXPECT_EQ(ImageFrame::FrameComplete, frameBuffers[i].getStatus()); 249 EXPECT_EQ(ImageFrame::FrameComplete, frameBuffers[i].getStatus());
249 else 250 else
250 EXPECT_EQ(ImageFrame::FrameEmpty, frameBuffers[i].getStatus()); 251 EXPECT_EQ(ImageFrame::FrameEmpty, frameBuffers[i].getStatus());
251 } 252 }
252 } 253 }
253 254
254 } // namespace blink 255 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698