OLD | NEW |
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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 m_imageRef = 0; | 69 m_imageRef = 0; |
70 } | 70 } |
71 | 71 |
72 void WebImage::assign(const WebImage& image) | 72 void WebImage::assign(const WebImage& image) |
73 { | 73 { |
74 assign(image.m_imageRef); | 74 assign(image.m_imageRef); |
75 } | 75 } |
76 | 76 |
77 bool WebImage::isNull() const | 77 bool WebImage::isNull() const |
78 { | 78 { |
79 return m_imageRef != 0; | 79 return m_imageRef == 0; |
80 } | 80 } |
81 | 81 |
82 WebSize WebImage::size() const | 82 WebSize WebImage::size() const |
83 { | 83 { |
84 return WebSize(CGImageGetWidth(m_imageRef), CGImageGetHeight(m_imageRef)); | 84 return WebSize(CGImageGetWidth(m_imageRef), CGImageGetHeight(m_imageRef)); |
85 } | 85 } |
86 | 86 |
87 WebImage::WebImage(const PassRefPtr<Image>& image) | 87 WebImage::WebImage(const PassRefPtr<Image>& image) |
88 : m_imageRef(0) | 88 : m_imageRef(0) |
89 { | 89 { |
(...skipping 10 matching lines...) Expand all Loading... |
100 return *this; | 100 return *this; |
101 } | 101 } |
102 | 102 |
103 void WebImage::assign(CGImageRef imageRef) | 103 void WebImage::assign(CGImageRef imageRef) |
104 { | 104 { |
105 CGImageRelease(m_imageRef); | 105 CGImageRelease(m_imageRef); |
106 CGImageRetain(m_imageRef = imageRef); | 106 CGImageRetain(m_imageRef = imageRef); |
107 } | 107 } |
108 | 108 |
109 } // namespace WebKit | 109 } // namespace WebKit |
OLD | NEW |