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

Side by Side Diff: Source/core/rendering/RenderImage.cpp

Issue 139103009: If a compositing update is declared as needed, scheduleAnimation should be triggered. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: patch for landing, added crbug to fixme comment Created 6 years, 10 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/page/ChromeClient.h ('k') | Source/core/rendering/RenderLayerCompositor.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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Allan Sandfeld Jensen (kde@carewolf.com) 5 * (C) 2006 Allan Sandfeld Jensen (kde@carewolf.com)
6 * (C) 2006 Samuel Weinig (sam.weinig@gmail.com) 6 * (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
8 * Copyright (C) 2010 Google Inc. All rights reserved. 8 * Copyright (C) 2010 Google Inc. All rights reserved.
9 * Copyright (C) Research In Motion Limited 2011-2012. All rights reserved. 9 * Copyright (C) Research In Motion Limited 2011-2012. All rights reserved.
10 * 10 *
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 153
154 if (hasBoxDecorations() || hasMask()) 154 if (hasBoxDecorations() || hasMask())
155 RenderReplaced::imageChanged(newImage, rect); 155 RenderReplaced::imageChanged(newImage, rect);
156 156
157 if (!m_imageResource) 157 if (!m_imageResource)
158 return; 158 return;
159 159
160 if (newImage != m_imageResource->imagePtr()) 160 if (newImage != m_imageResource->imagePtr())
161 return; 161 return;
162 162
163 // FIXME: this is a quick fix for crbug.com/328069. Perhaps this is reasonab le to keep for the long term, or
164 // perhaps it's too aggressive, and we need to identify when the image *real ly* changed before issuing this call?
165 document().view()->scheduleAnimation();
166
167 // Per the spec, we let the server-sent header override srcset/other sources of dpr. 163 // Per the spec, we let the server-sent header override srcset/other sources of dpr.
168 // https://github.com/igrigorik/http-client-hints/blob/master/draft-grigorik -http-client-hints-01.txt#L255 164 // https://github.com/igrigorik/http-client-hints/blob/master/draft-grigorik -http-client-hints-01.txt#L255
169 if (m_imageResource->cachedImage() && m_imageResource->cachedImage()->hasDev icePixelRatioHeaderValue()) 165 if (m_imageResource->cachedImage() && m_imageResource->cachedImage()->hasDev icePixelRatioHeaderValue())
170 m_imageDevicePixelRatio = 1 / m_imageResource->cachedImage()->devicePixe lRatioHeaderValue(); 166 m_imageDevicePixelRatio = 1 / m_imageResource->cachedImage()->devicePixe lRatioHeaderValue();
171 167
172 if (!m_didIncrementVisuallyNonEmptyPixelCount) { 168 if (!m_didIncrementVisuallyNonEmptyPixelCount) {
173 // At a zoom level of 1 the image is guaranteed to have an integer size. 169 // At a zoom level of 1 the image is guaranteed to have an integer size.
174 view()->frameView()->incrementVisuallyNonEmptyPixelCount(flooredIntSize( m_imageResource->imageSize(1.0f))); 170 view()->frameView()->incrementVisuallyNonEmptyPixelCount(flooredIntSize( m_imageResource->imageSize(1.0f)));
175 m_didIncrementVisuallyNonEmptyPixelCount = true; 171 m_didIncrementVisuallyNonEmptyPixelCount = true;
176 } 172 }
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 return 0; 626 return 0;
631 627
632 ImageResource* cachedImage = m_imageResource->cachedImage(); 628 ImageResource* cachedImage = m_imageResource->cachedImage();
633 if (cachedImage && cachedImage->image() && cachedImage->image()->isSVGImage( )) 629 if (cachedImage && cachedImage->image() && cachedImage->image()->isSVGImage( ))
634 return toSVGImage(cachedImage->image())->embeddedContentBox(); 630 return toSVGImage(cachedImage->image())->embeddedContentBox();
635 631
636 return 0; 632 return 0;
637 } 633 }
638 634
639 } // namespace WebCore 635 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/page/ChromeClient.h ('k') | Source/core/rendering/RenderLayerCompositor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698