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

Side by Side Diff: Source/core/loader/cache/CachedImage.cpp

Issue 19393004: Allow eviction of ImageBitmaps that are created from ImageElements. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 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 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 void CachedImage::decodedSizeChanged(const Image* image, int delta) 395 void CachedImage::decodedSizeChanged(const Image* image, int delta)
396 { 396 {
397 if (!image || image != m_image) 397 if (!image || image != m_image)
398 return; 398 return;
399 399
400 setDecodedSize(decodedSize() + delta); 400 setDecodedSize(decodedSize() + delta);
401 } 401 }
402 402
403 void CachedImage::didDraw(const Image* image) 403 void CachedImage::didDraw(const Image* image)
404 { 404 {
405 if (!image || image != m_image) 405 // FIXME: not sure if this change is valid. Since taking a subset
406 // produces a different image, m_image != image for ImageBitmaps
Justin Novosad 2013/07/19 21:09:53 We need a better condition. Something like !m_imag
407 if (!image)
406 return; 408 return;
407 409
408 double timeStamp = FrameView::currentPaintTimeStamp(); 410 double timeStamp = FrameView::currentPaintTimeStamp();
409 if (!timeStamp) // If didDraw is called outside of a Frame paint. 411 if (!timeStamp) // If didDraw is called outside of a Frame paint.
410 timeStamp = currentTime(); 412 timeStamp = currentTime();
411 413
412 CachedResource::didAccessDecodedData(timeStamp); 414 CachedResource::didAccessDecodedData(timeStamp);
413 } 415 }
414 416
415 bool CachedImage::shouldPauseAnimation(const Image* image) 417 bool CachedImage::shouldPauseAnimation(const Image* image)
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 454
453 bool CachedImage::currentFrameKnownToBeOpaque(const RenderObject* renderer) 455 bool CachedImage::currentFrameKnownToBeOpaque(const RenderObject* renderer)
454 { 456 {
455 Image* image = imageForRenderer(renderer); 457 Image* image = imageForRenderer(renderer);
456 if (image->isBitmapImage()) 458 if (image->isBitmapImage())
457 image->nativeImageForCurrentFrame(); // force decode 459 image->nativeImageForCurrentFrame(); // force decode
458 return image->currentFrameKnownToBeOpaque(); 460 return image->currentFrameKnownToBeOpaque();
459 } 461 }
460 462
461 } // namespace WebCore 463 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698