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

Side by Side Diff: WebKit/chromium/src/WebImageCG.cpp

Issue 2850034: Merge 60977 - Not reviewed, Chromium build fix from Abhishek Arya.... (Closed) Base URL: svn://chrome-svn/chrome/branches/WebKit/375/
Patch Set: Created 10 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
« no previous file with comments | « no previous file | no next file » | 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) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 WebSize WebImage::size() const 84 WebSize WebImage::size() const
85 { 85 {
86 return WebSize(CGImageGetWidth(m_imageRef), CGImageGetHeight(m_imageRef)); 86 return WebSize(CGImageGetWidth(m_imageRef), CGImageGetHeight(m_imageRef));
87 } 87 }
88 88
89 WebImage::WebImage(const PassRefPtr<Image>& image) 89 WebImage::WebImage(const PassRefPtr<Image>& image)
90 : m_imageRef(0) 90 : m_imageRef(0)
91 { 91 {
92 NativeImagePtr p; 92 NativeImagePtr p;
93 if (image.get() && (p = image->nativeImageForCurrentFrame())) 93 if (image.get() && (p = image->nativeImageForCurrentFrame()))
94 assign(*p); 94 assign(p);
95 } 95 }
96 96
97 WebImage& WebImage::operator=(const PassRefPtr<Image>& image) 97 WebImage& WebImage::operator=(const PassRefPtr<Image>& image)
98 { 98 {
99 NativeImagePtr p; 99 NativeImagePtr p;
100 if (image.get() && (p = image->nativeImageForCurrentFrame())) 100 if (image.get() && (p = image->nativeImageForCurrentFrame()))
101 assign(*p); 101 assign(p);
102 else 102 else
103 reset(); 103 reset();
104 return *this; 104 return *this;
105 } 105 }
106 106
107 void WebImage::assign(CGImageRef imageRef) 107 void WebImage::assign(CGImageRef imageRef)
108 { 108 {
109 // Make sure to retain the imageRef first incase m_imageRef == imageRef. 109 // Make sure to retain the imageRef first incase m_imageRef == imageRef.
110 CGImageRetain(imageRef); 110 CGImageRetain(imageRef);
111 CGImageRelease(m_imageRef); 111 CGImageRelease(m_imageRef);
112 m_imageRef = imageRef; 112 m_imageRef = imageRef;
113 } 113 }
114 114
115 } // namespace WebKit 115 } // namespace WebKit
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698