OLD | NEW |
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 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 static bool sizeCalculationMayOverflow(unsigned width, unsigned height) { | 399 static bool sizeCalculationMayOverflow(unsigned width, unsigned height) { |
400 unsigned long long total_size = static_cast<unsigned long long>(width) * | 400 unsigned long long total_size = static_cast<unsigned long long>(width) * |
401 static_cast<unsigned long long>(height); | 401 static_cast<unsigned long long>(height); |
402 return total_size > ((1 << 29) - 1); | 402 return total_size > ((1 << 29) - 1); |
403 } | 403 } |
404 | 404 |
405 bool m_purgeAggressively; | 405 bool m_purgeAggressively; |
406 | 406 |
407 // This methods gets called at the end of initFrameBuffer. Subclasses can do | 407 // This methods gets called at the end of initFrameBuffer. Subclasses can do |
408 // format specific initialization, for e.g. alpha settings, here. | 408 // format specific initialization, for e.g. alpha settings, here. |
409 virtual void onInitFrameBuffer(size_t){}; | 409 virtual bool onInitFrameBuffer(size_t) { return true; }; |
410 | 410 |
411 // Called by initFrameBuffer to determine if it can take the bitmap of the | 411 // Called by initFrameBuffer to determine if it can take the bitmap of the |
412 // previous frame. This condition is different for GIF and WEBP. | 412 // previous frame. This condition is different for GIF and WEBP. |
413 virtual bool canReusePreviousFrameBuffer(size_t) const { return false; } | 413 virtual bool canReusePreviousFrameBuffer(size_t) const { return false; } |
414 | 414 |
415 IntSize m_size; | 415 IntSize m_size; |
416 bool m_sizeAvailable = false; | 416 bool m_sizeAvailable = false; |
417 bool m_isAllDataReceived = false; | 417 bool m_isAllDataReceived = false; |
418 bool m_failed = false; | 418 bool m_failed = false; |
419 bool m_hasHistogrammedColorSpace = false; | 419 bool m_hasHistogrammedColorSpace = false; |
420 | 420 |
421 sk_sp<SkColorSpace> m_embeddedColorSpace = nullptr; | 421 sk_sp<SkColorSpace> m_embeddedColorSpace = nullptr; |
422 bool m_sourceToTargetColorTransformNeedsUpdate = false; | 422 bool m_sourceToTargetColorTransformNeedsUpdate = false; |
423 std::unique_ptr<SkColorSpaceXform> m_sourceToTargetColorTransform; | 423 std::unique_ptr<SkColorSpaceXform> m_sourceToTargetColorTransform; |
424 }; | 424 }; |
425 | 425 |
426 } // namespace blink | 426 } // namespace blink |
427 | 427 |
428 #endif | 428 #endif |
OLD | NEW |