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

Side by Side Diff: third_party/WebKit/Source/core/css/cssom/CSSStyleImageValue.cpp

Issue 2469873002: [ImageResource 4] Split ImageResource into Resource and Image parts (Closed)
Patch Set: style Created 4 years 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/css/cssom/CSSStyleImageValue.h" 5 #include "core/css/cssom/CSSStyleImageValue.h"
6 6
7 namespace blink { 7 namespace blink {
8 8
9 double CSSStyleImageValue::intrinsicWidth(bool& isNull) const { 9 double CSSStyleImageValue::intrinsicWidth(bool& isNull) const {
10 isNull = isCachePending(); 10 isNull = isCachePending();
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 46
47 int CSSStyleImageValue::sourceWidth() { 47 int CSSStyleImageValue::sourceWidth() {
48 bool notUsed; 48 bool notUsed;
49 return intrinsicWidth(notUsed); 49 return intrinsicWidth(notUsed);
50 } 50 }
51 51
52 PassRefPtr<Image> CSSStyleImageValue::image() const { 52 PassRefPtr<Image> CSSStyleImageValue::image() const {
53 if (isCachePending()) 53 if (isCachePending())
54 return nullptr; 54 return nullptr;
55 // cachedImage can be null if image is StyleInvalidImage 55 // cachedImage can be null if image is StyleInvalidImage
56 ImageResource* cachedImage = m_imageValue->cachedImage()->cachedImage(); 56 ImageResourceContent* cachedImage =
57 m_imageValue->cachedImage()->cachedImage();
57 if (cachedImage) { 58 if (cachedImage) {
58 // getImage() returns the nullImage() if the image is not available yet 59 // getImage() returns the nullImage() if the image is not available yet
59 return cachedImage->getImage()->imageForDefaultFrame(); 60 return cachedImage->getImage()->imageForDefaultFrame();
60 } 61 }
61 return nullptr; 62 return nullptr;
62 } 63 }
63 64
64 } // namespace blink 65 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/cssom/CSSStyleImageValue.h ('k') | third_party/WebKit/Source/core/editing/Editor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698