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

Side by Side Diff: webkit/glue/plugins/pepper_image_data.cc

Issue 3014034: Linux: Fix some NULL versus 0 issues to appease gcc-4.5. (Closed)
Patch Set: Created 10 years, 4 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
« no previous file with comments | « webkit/glue/plugins/pepper_font.cc ('k') | webkit/glue/plugins/pepper_scrollbar.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "webkit/glue/plugins/pepper_image_data.h" 5 #include "webkit/glue/plugins/pepper_image_data.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 13 matching lines...) Expand all
24 PP_ImageDataFormat GetNativeImageDataFormat() { 24 PP_ImageDataFormat GetNativeImageDataFormat() {
25 return PP_IMAGEDATAFORMAT_BGRA_PREMUL; 25 return PP_IMAGEDATAFORMAT_BGRA_PREMUL;
26 } 26 }
27 27
28 PP_Resource Create(PP_Module module_id, 28 PP_Resource Create(PP_Module module_id,
29 PP_ImageDataFormat format, 29 PP_ImageDataFormat format,
30 const PP_Size* size, 30 const PP_Size* size,
31 bool init_to_zero) { 31 bool init_to_zero) {
32 PluginModule* module = PluginModule::FromPPModule(module_id); 32 PluginModule* module = PluginModule::FromPPModule(module_id);
33 if (!module) 33 if (!module)
34 return NULL; 34 return 0;
35 35
36 scoped_refptr<ImageData> data(new ImageData(module)); 36 scoped_refptr<ImageData> data(new ImageData(module));
37 if (!data->Init(format, size->width, size->height, init_to_zero)) 37 if (!data->Init(format, size->width, size->height, init_to_zero))
38 return NULL; 38 return 0;
39 39
40 return data->GetReference(); 40 return data->GetReference();
41 } 41 }
42 42
43 bool IsImageData(PP_Resource resource) { 43 bool IsImageData(PP_Resource resource) {
44 return !!Resource::GetAs<ImageData>(resource); 44 return !!Resource::GetAs<ImageData>(resource);
45 } 45 }
46 46
47 bool Describe(PP_Resource resource, PP_ImageDataDesc* desc) { 47 bool Describe(PP_Resource resource, PP_ImageDataDesc* desc) {
48 // Give predictable values on failure. 48 // Give predictable values on failure.
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 } 150 }
151 151
152 void ImageData::Swap(ImageData* other) { 152 void ImageData::Swap(ImageData* other) {
153 swap(other->platform_image_, platform_image_); 153 swap(other->platform_image_, platform_image_);
154 swap(other->mapped_canvas_, mapped_canvas_); 154 swap(other->mapped_canvas_, mapped_canvas_);
155 std::swap(other->width_, width_); 155 std::swap(other->width_, width_);
156 std::swap(other->height_, height_); 156 std::swap(other->height_, height_);
157 } 157 }
158 158
159 } // namespace pepper 159 } // namespace pepper
OLDNEW
« no previous file with comments | « webkit/glue/plugins/pepper_font.cc ('k') | webkit/glue/plugins/pepper_scrollbar.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698