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 * | 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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 // that width == (size().width() - frameContext->xOffset), so | 110 // that width == (size().width() - frameContext->xOffset), so |
111 // we must ensure we don't run off the end of either the source data or the | 111 // we must ensure we don't run off the end of either the source data or the |
112 // row's X-coordinates. | 112 // row's X-coordinates. |
113 const int xBegin = frameContext->xOffset(); | 113 const int xBegin = frameContext->xOffset(); |
114 const int yBegin = frameContext->yOffset() + rowNumber; | 114 const int yBegin = frameContext->yOffset() + rowNumber; |
115 const int xEnd = std::min(static_cast<int>(frameContext->xOffset() + width),
size().width()); | 115 const int xEnd = std::min(static_cast<int>(frameContext->xOffset() + width),
size().width()); |
116 const int yEnd = std::min(static_cast<int>(frameContext->yOffset() + rowNumb
er + repeatCount), size().height()); | 116 const int yEnd = std::min(static_cast<int>(frameContext->yOffset() + rowNumb
er + repeatCount), size().height()); |
117 if (!width || (xBegin < 0) || (yBegin < 0) || (xEnd <= xBegin) || (yEnd <= y
Begin)) | 117 if (!width || (xBegin < 0) || (yBegin < 0) || (xEnd <= xBegin) || (yEnd <= y
Begin)) |
118 return true; | 118 return true; |
119 | 119 |
120 const GIFColorMap::Table& colorTable = frameContext->localColorMap().isDefin
ed() ? frameContext->localColorMap().table() : m_reader->globalColorMap().table(
); | 120 const GIFColorMap::Table& colorTable = frameContext->localColorMap().isDefin
ed() ? frameContext->localColorMap().getTable() : m_reader->globalColorMap().get
Table(); |
121 | 121 |
122 if (colorTable.isEmpty()) | 122 if (colorTable.isEmpty()) |
123 return true; | 123 return true; |
124 | 124 |
125 GIFColorMap::Table::const_iterator colorTableIter = colorTable.begin(); | 125 GIFColorMap::Table::const_iterator colorTableIter = colorTable.begin(); |
126 | 126 |
127 // Initialize the frame if necessary. | 127 // Initialize the frame if necessary. |
128 ImageFrame& buffer = m_frameBufferCache[frameIndex]; | 128 ImageFrame& buffer = m_frameBufferCache[frameIndex]; |
129 if ((buffer.getStatus() == ImageFrame::FrameEmpty) && !initFrameBuffer(frame
Index)) | 129 if ((buffer.getStatus() == ImageFrame::FrameEmpty) && !initFrameBuffer(frame
Index)) |
130 return false; | 130 return false; |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 | 368 |
369 // Update our status to be partially complete. | 369 // Update our status to be partially complete. |
370 buffer->setStatus(ImageFrame::FramePartial); | 370 buffer->setStatus(ImageFrame::FramePartial); |
371 | 371 |
372 // Reset the alpha pixel tracker for this frame. | 372 // Reset the alpha pixel tracker for this frame. |
373 m_currentBufferSawAlpha = false; | 373 m_currentBufferSawAlpha = false; |
374 return true; | 374 return true; |
375 } | 375 } |
376 | 376 |
377 } // namespace blink | 377 } // namespace blink |
OLD | NEW |