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

Side by Side Diff: ppapi/cpp/image_data.cc

Issue 375133003: Fixes for re-enabling more MSVC level 4 warnings: ppapi/ edition (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ppapi/cpp/image_data.h" 5 #include "ppapi/cpp/image_data.h"
6 6
7 #include <string.h> // Needed for memset. 7 #include <string.h> // Needed for memset.
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 // static 85 // static
86 PP_ImageDataFormat ImageData::GetNativeImageDataFormat() { 86 PP_ImageDataFormat ImageData::GetNativeImageDataFormat() {
87 if (!has_interface<PPB_ImageData_1_0>()) 87 if (!has_interface<PPB_ImageData_1_0>())
88 return PP_IMAGEDATAFORMAT_BGRA_PREMUL; // Default to something on failure. 88 return PP_IMAGEDATAFORMAT_BGRA_PREMUL; // Default to something on failure.
89 return get_interface<PPB_ImageData_1_0>()->GetNativeImageDataFormat(); 89 return get_interface<PPB_ImageData_1_0>()->GetNativeImageDataFormat();
90 } 90 }
91 91
92 void ImageData::InitData() { 92 void ImageData::InitData() {
93 if (!has_interface<PPB_ImageData_1_0>()) 93 if (!has_interface<PPB_ImageData_1_0>())
94 return; 94 return;
95 if (!get_interface<PPB_ImageData_1_0>()->Describe(pp_resource(), &desc_) || 95 if (get_interface<PPB_ImageData_1_0>()->Describe(pp_resource(), &desc_)) {
96 !(data_ = get_interface<PPB_ImageData_1_0>()->Map(pp_resource()))) 96 data_ = get_interface<PPB_ImageData_1_0>()->Map(pp_resource());
97 *this = ImageData(); 97 if (data_)
98 return;
99 }
100 *this = ImageData();
98 } 101 }
99 102
100 } // namespace pp 103 } // namespace pp
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698