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

Side by Side Diff: third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h

Issue 2495183002: Pull up initFrameBuffer to ImageDecoder. (Closed)
Patch Set: Make ImageDecoder::initFrameBuffer const-correct. 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
3 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. 3 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
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 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 294
295 virtual void clearFrameBuffer(size_t frameIndex); 295 virtual void clearFrameBuffer(size_t frameIndex);
296 296
297 // Decodes the image sufficiently to determine the image size. 297 // Decodes the image sufficiently to determine the image size.
298 virtual void decodeSize() = 0; 298 virtual void decodeSize() = 0;
299 299
300 // Decodes the image sufficiently to determine the number of frames and 300 // Decodes the image sufficiently to determine the number of frames and
301 // returns that number. 301 // returns that number.
302 virtual size_t decodeFrameCount() { return 1; } 302 virtual size_t decodeFrameCount() { return 1; }
303 303
304 // Called to initialize the frame buffer with the given index, based on the
305 // provided and previous frame's characteristics. Returns true on success. On
306 // failure, this will mark the image as failed. Before calling this method,
307 // the callee must verify that the frame exists.
scroggo_chromium 2016/11/14 13:51:45 caller*
joostouwerling 2016/11/14 16:25:09 Done.
308 virtual bool initFrameBuffer(size_t);
309
310 // Called by initFrameBuffer to determine if it can take the bitmap of the
311 // previous frame. This condition is different for GIF and WEBP.
312 virtual bool canReusePreviousFrameBuffer(size_t) const { return false; }
scroggo_chromium 2016/11/14 13:51:45 This one doesn't actually need to be virtual. We n
joostouwerling 2016/11/14 16:25:09 For only GIF and WebP, this would be fine, but for
313
304 // Performs any additional setup of the requested frame after it has been 314 // Performs any additional setup of the requested frame after it has been
305 // initially created, e.g. setting a duration or disposal method. 315 // initially created, e.g. setting a duration or disposal method.
306 virtual void initializeNewFrame(size_t) {} 316 virtual void initializeNewFrame(size_t) {}
307 317
308 // Decodes the requested frame. 318 // Decodes the requested frame.
309 virtual void decode(size_t) = 0; 319 virtual void decode(size_t) = 0;
310 320
311 RefPtr<SegmentReader> m_data; // The encoded data. 321 RefPtr<SegmentReader> m_data; // The encoded data.
312 Vector<ImageFrame, 1> m_frameBufferCache; 322 Vector<ImageFrame, 1> m_frameBufferCache;
313 const bool m_premultiplyAlpha; 323 const bool m_premultiplyAlpha;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 bool m_isAllDataReceived = false; 356 bool m_isAllDataReceived = false;
347 bool m_failed = false; 357 bool m_failed = false;
348 358
349 sk_sp<SkColorSpace> m_embeddedColorSpace = nullptr; 359 sk_sp<SkColorSpace> m_embeddedColorSpace = nullptr;
350 std::unique_ptr<SkColorSpaceXform> m_sourceToOutputDeviceColorTransform; 360 std::unique_ptr<SkColorSpaceXform> m_sourceToOutputDeviceColorTransform;
351 }; 361 };
352 362
353 } // namespace blink 363 } // namespace blink
354 364
355 #endif 365 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698