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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/test/MockImageDecoder.h

Issue 2556723003: Merge color options into ColorBehavior (Closed)
Patch Set: Feedback 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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 60
61 class MockImageDecoder : public ImageDecoder { 61 class MockImageDecoder : public ImageDecoder {
62 public: 62 public:
63 static std::unique_ptr<MockImageDecoder> create( 63 static std::unique_ptr<MockImageDecoder> create(
64 MockImageDecoderClient* client) { 64 MockImageDecoderClient* client) {
65 return makeUnique<MockImageDecoder>(client); 65 return makeUnique<MockImageDecoder>(client);
66 } 66 }
67 67
68 MockImageDecoder(MockImageDecoderClient* client) 68 MockImageDecoder(MockImageDecoderClient* client)
69 : ImageDecoder(AlphaPremultiplied, 69 : ImageDecoder(AlphaPremultiplied,
70 ColorSpaceTransformed, 70 ColorBehavior::transformToTargetForTesting(),
71 targetColorSpaceForTesting(),
72 noDecodedImageByteLimit), 71 noDecodedImageByteLimit),
73 m_client(client) {} 72 m_client(client) {}
74 73
75 ~MockImageDecoder() { m_client->decoderBeingDestroyed(); } 74 ~MockImageDecoder() { m_client->decoderBeingDestroyed(); }
76 75
77 IntSize decodedSize() const override { 76 IntSize decodedSize() const override {
78 return m_client->decodedSize().isEmpty() ? size() : m_client->decodedSize(); 77 return m_client->decodedSize().isEmpty() ? size() : m_client->decodedSize();
79 } 78 }
80 79
81 String filenameExtension() const override { return "mock"; } 80 String filenameExtension() const override { return "mock"; }
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 const IntSize& decodedSize) 146 const IntSize& decodedSize)
148 : m_client(client), m_decodedSize(decodedSize) {} 147 : m_client(client), m_decodedSize(decodedSize) {}
149 148
150 MockImageDecoderClient* m_client; 149 MockImageDecoderClient* m_client;
151 IntSize m_decodedSize; 150 IntSize m_decodedSize;
152 }; 151 };
153 152
154 } // namespace blink 153 } // namespace blink
155 154
156 #endif // MockImageDecoder_h 155 #endif // MockImageDecoder_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698