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

Side by Side Diff: Source/core/fetch/ImageResource.cpp

Issue 352873002: [wip] image color correction (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 months 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 | Annotate | Revision Log
OLDNEW
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 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 memoryCache()->remove(this); 374 memoryCache()->remove(this);
375 return; 375 return;
376 } 376 }
377 377
378 // It would be nice to only redraw the decoded band of the image, but wi th the current design 378 // It would be nice to only redraw the decoded band of the image, but wi th the current design
379 // (decoding delayed until painting) that seems hard. 379 // (decoding delayed until painting) that seems hard.
380 notifyObservers(); 380 notifyObservers();
381 } 381 }
382 } 382 }
383 383
384 void ImageResource::updateBitmapImages(HashSet<ImageResource*>& images, bool red ecodeImages)
385 {
386 if (redecodeImages) {
387 for (HashSet<ImageResource*>::iterator it = images.begin(); it != images .end(); ++it) {
388 ImageResource* imageResource = *it;
389 imageResource->prune();
390 if (!imageResource->hasImage())
391 continue;
392 BitmapImage* image = toBitmapImage(imageResource->image());
393 image->resetDecoder();
394 imageResource->updateImage(image->isAllDataReceived());
395 }
396 } else {
397 for (HashSet<ImageResource*>::iterator it = images.begin(); it != images .end(); ++it) {
398 ImageResource* imageResource = *it;
399 BitmapImage* image = toBitmapImage(imageResource->image());
400 imageResource->updateImage(image->isAllDataReceived());
401 }
402 }
403 }
404
384 void ImageResource::finishOnePart() 405 void ImageResource::finishOnePart()
385 { 406 {
386 if (m_loadingMultipartContent) 407 if (m_loadingMultipartContent)
387 clear(); 408 clear();
388 updateImage(true); 409 updateImage(true);
389 if (m_loadingMultipartContent) 410 if (m_loadingMultipartContent)
390 m_data.clear(); 411 m_data.clear();
391 Resource::finishOnePart(); 412 Resource::finishOnePart();
392 } 413 }
393 414
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 bool ImageResource::isAccessAllowed(SecurityOrigin* securityOrigin) 489 bool ImageResource::isAccessAllowed(SecurityOrigin* securityOrigin)
469 { 490 {
470 if (!image()->currentFrameHasSingleSecurityOrigin()) 491 if (!image()->currentFrameHasSingleSecurityOrigin())
471 return false; 492 return false;
472 if (passesAccessControlCheck(securityOrigin)) 493 if (passesAccessControlCheck(securityOrigin))
473 return true; 494 return true;
474 return !securityOrigin->taintsCanvas(response().url()); 495 return !securityOrigin->taintsCanvas(response().url());
475 } 496 }
476 497
477 } // namespace WebCore 498 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698