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

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

Issue 1008243003: Nuke NativeImageSkia -- new version. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add more WARN_UNUSED_RETURN goodness Created 5 years, 9 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
« no previous file with comments | « Source/core/clipboard/Pasteboard.cpp ('k') | Source/core/frame/ImageBitmap.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 if (!image || image != m_image) 486 if (!image || image != m_image)
487 return; 487 return;
488 notifyObservers(&rect); 488 notifyObservers(&rect);
489 } 489 }
490 490
491 bool ImageResource::currentFrameKnownToBeOpaque(const LayoutObject* renderer) 491 bool ImageResource::currentFrameKnownToBeOpaque(const LayoutObject* renderer)
492 { 492 {
493 blink::Image* image = imageForRenderer(renderer); 493 blink::Image* image = imageForRenderer(renderer);
494 if (image->isBitmapImage()) { 494 if (image->isBitmapImage()) {
495 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "PaintImage ", "data", InspectorPaintImageEvent::data(renderer, *this)); 495 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "PaintImage ", "data", InspectorPaintImageEvent::data(renderer, *this));
496 image->nativeImageForCurrentFrame(); // force decode 496 SkBitmap dummy;
497 if (!image->bitmapForCurrentFrame(&dummy)) { // force decode
498 // We don't care about failures here, since we don't use "dummy"
499 }
497 } 500 }
498 return image->currentFrameKnownToBeOpaque(); 501 return image->currentFrameKnownToBeOpaque();
499 } 502 }
500 503
501 bool ImageResource::isAccessAllowed(ExecutionContext* context, SecurityOrigin* s ecurityOrigin) 504 bool ImageResource::isAccessAllowed(ExecutionContext* context, SecurityOrigin* s ecurityOrigin)
502 { 505 {
503 if (response().wasFetchedViaServiceWorker()) 506 if (response().wasFetchedViaServiceWorker())
504 return response().serviceWorkerResponseType() != WebServiceWorkerRespons eTypeOpaque; 507 return response().serviceWorkerResponseType() != WebServiceWorkerRespons eTypeOpaque;
505 if (!image()->currentFrameHasSingleSecurityOrigin()) 508 if (!image()->currentFrameHasSingleSecurityOrigin())
506 return false; 509 return false;
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
542 if (node && isHTMLImageElement(node)) { 545 if (node && isHTMLImageElement(node)) {
543 const AtomicString& urlString = toHTMLImageElement(node)->imageSourceURL (); 546 const AtomicString& urlString = toHTMLImageElement(node)->imageSourceURL ();
544 KURL url = node->document().completeURL(urlString); 547 KURL url = node->document().completeURL(urlString);
545 imageForContainer->setURL(url); 548 imageForContainer->setURL(url);
546 } 549 }
547 550
548 return imageForContainer.get(); 551 return imageForContainer.get();
549 } 552 }
550 553
551 } // namespace blink 554 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/clipboard/Pasteboard.cpp ('k') | Source/core/frame/ImageBitmap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698