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

Side by Side Diff: ppapi/shared_impl/ppb_image_data_shared.cc

Issue 174213003: PPAPI: Use clang-format on ppapi/shared_impl (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: remove DEPS Created 6 years, 10 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
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/shared_impl/ppb_image_data_shared.h" 5 #include "ppapi/shared_impl/ppb_image_data_shared.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 9
10 #if !defined(OS_NACL) && !defined(NACL_WIN64) 10 #if !defined(OS_NACL) && !defined(NACL_WIN64)
(...skipping 13 matching lines...) Expand all
24 // In the NaCl Win64 helper, this shouldn't be called. If we start building 24 // In the NaCl Win64 helper, this shouldn't be called. If we start building
25 // Chrome on Windows 64 for realz, we should really implement this. 25 // Chrome on Windows 64 for realz, we should really implement this.
26 NOTIMPLEMENTED(); 26 NOTIMPLEMENTED();
27 return PP_IMAGEDATAFORMAT_BGRA_PREMUL; 27 return PP_IMAGEDATAFORMAT_BGRA_PREMUL;
28 #else 28 #else
29 if (SK_B32_SHIFT == 0) 29 if (SK_B32_SHIFT == 0)
30 return PP_IMAGEDATAFORMAT_BGRA_PREMUL; 30 return PP_IMAGEDATAFORMAT_BGRA_PREMUL;
31 else if (SK_R32_SHIFT == 0) 31 else if (SK_R32_SHIFT == 0)
32 return PP_IMAGEDATAFORMAT_RGBA_PREMUL; 32 return PP_IMAGEDATAFORMAT_RGBA_PREMUL;
33 else 33 else
34 return PP_IMAGEDATAFORMAT_BGRA_PREMUL; // Default to something on failure 34 return PP_IMAGEDATAFORMAT_BGRA_PREMUL; // Default to something on failure
35 #endif 35 #endif
36 } 36 }
37 37
38 // static 38 // static
39 PP_Bool PPB_ImageData_Shared::IsImageDataFormatSupported( 39 PP_Bool PPB_ImageData_Shared::IsImageDataFormatSupported(
40 PP_ImageDataFormat format) { 40 PP_ImageDataFormat format) {
41 return PP_FromBool(format == PP_IMAGEDATAFORMAT_BGRA_PREMUL || 41 return PP_FromBool(format == PP_IMAGEDATAFORMAT_BGRA_PREMUL ||
42 format == PP_IMAGEDATAFORMAT_RGBA_PREMUL); 42 format == PP_IMAGEDATAFORMAT_RGBA_PREMUL);
43 } 43 }
44 44
45 // static 45 // static
46 PP_Bool PPB_ImageData_Shared::IsImageDataDescValid( 46 PP_Bool PPB_ImageData_Shared::IsImageDataDescValid(
47 const PP_ImageDataDesc& desc) { 47 const PP_ImageDataDesc& desc) {
48 return PP_FromBool(IsImageDataFormatSupported(desc.format) && 48 return PP_FromBool(IsImageDataFormatSupported(desc.format) &&
49 desc.size.width > 0 && 49 desc.size.width > 0 && desc.size.height > 0 &&
50 desc.size.height > 0 &&
51 desc.stride > 0); 50 desc.stride > 0);
52 } 51 }
53 52
54 } // namespace ppapi 53 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/shared_impl/ppb_graphics_3d_shared.cc ('k') | ppapi/shared_impl/ppb_input_event_shared.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698