| OLD | NEW |
| 1 /* | 1 /* |
| 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) | 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) |
| 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) | 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) |
| 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) | 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) |
| 5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) | 5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) |
| 6 Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. | 6 Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. |
| 7 | 7 |
| 8 This library is free software; you can redistribute it and/or | 8 This library is free software; you can redistribute it and/or |
| 9 modify it under the terms of the GNU Library General Public | 9 modify it under the terms of the GNU Library General Public |
| 10 License as published by the Free Software Foundation; either | 10 License as published by the Free Software Foundation; either |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 memoryCache()->remove(this); | 330 memoryCache()->remove(this); |
| 331 return; | 331 return; |
| 332 } | 332 } |
| 333 | 333 |
| 334 // It would be nice to only redraw the decoded band of the image, but wi
th the current design | 334 // It would be nice to only redraw the decoded band of the image, but wi
th the current design |
| 335 // (decoding delayed until painting) that seems hard. | 335 // (decoding delayed until painting) that seems hard. |
| 336 notifyObservers(); | 336 notifyObservers(); |
| 337 } | 337 } |
| 338 } | 338 } |
| 339 | 339 |
| 340 void ImageResource::deviceProfileChanged(const blink::Image* image, ColorSpacePr
ofile* deviceProfile) |
| 341 { |
| 342 if (!image || image != m_image) |
| 343 return; |
| 344 |
| 345 RELEASE_ASSERT(m_image && m_image->isBitmapImage()); |
| 346 |
| 347 BitmapImage* bitmapImage = toBitmapImage(this->image()); |
| 348 RELEASE_ASSERT(bitmapImage->hasColorProfile()); |
| 349 |
| 350 bool allDataReceived = bitmapImage->isAllDataReceived(); |
| 351 if (!bitmapImage->resetDecoder(deviceProfile)) |
| 352 return; |
| 353 |
| 354 bool sizeAvailable = m_image->setData(m_data, allDataReceived); |
| 355 |
| 356 if (sizeAvailable || allDataReceived) { |
| 357 if (!m_image || m_image->isNull()) { |
| 358 error(errorOccurred() ? status() : DecodeError); |
| 359 if (memoryCache()->contains(this)) |
| 360 memoryCache()->remove(this); |
| 361 } |
| 362 } |
| 363 } |
| 364 |
| 340 void ImageResource::finishOnePart() | 365 void ImageResource::finishOnePart() |
| 341 { | 366 { |
| 342 if (loadingMultipartContent()) | 367 if (loadingMultipartContent()) |
| 343 clear(); | 368 clear(); |
| 344 updateImage(true); | 369 updateImage(true); |
| 345 if (loadingMultipartContent()) | 370 if (loadingMultipartContent()) |
| 346 m_data.clear(); | 371 m_data.clear(); |
| 347 Resource::finishOnePart(); | 372 Resource::finishOnePart(); |
| 348 } | 373 } |
| 349 | 374 |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 return true; | 494 return true; |
| 470 return !securityOrigin->taintsCanvas(response().url()); | 495 return !securityOrigin->taintsCanvas(response().url()); |
| 471 } | 496 } |
| 472 | 497 |
| 473 bool ImageResource::loadingMultipartContent() const | 498 bool ImageResource::loadingMultipartContent() const |
| 474 { | 499 { |
| 475 return m_loader && m_loader->loadingMultipartContent(); | 500 return m_loader && m_loader->loadingMultipartContent(); |
| 476 } | 501 } |
| 477 | 502 |
| 478 } // namespace blink | 503 } // namespace blink |
| OLD | NEW |