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

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

Issue 10828023: PPAPI/NaCl: Make NaClIPCAdapter transfer handles more generally (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: re-add gyp files Created 8 years, 3 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 | « ppapi/shared_impl/ppb_device_ref_shared.cc ('k') | ppapi/shared_impl/ppb_input_event_shared.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) 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 "build/build_config.h" 8 #include "build/build_config.h"
8 9
9 #if !defined(OS_NACL) 10 #if !defined(OS_NACL) && !defined(NACL_WIN64)
10 #include "third_party/skia/include/core/SkTypes.h" 11 #include "third_party/skia/include/core/SkTypes.h"
11 #endif 12 #endif
12 13
13 namespace ppapi { 14 namespace ppapi {
14 15
15 // static 16 // static
16 PP_ImageDataFormat PPB_ImageData_Shared::GetNativeImageDataFormat() { 17 PP_ImageDataFormat PPB_ImageData_Shared::GetNativeImageDataFormat() {
17 #if !defined(OS_NACL) 18 #if defined(OS_NACL)
18 if (SK_B32_SHIFT == 0) 19 // In NaCl, just default to something. If we're wrong, it will be converted
20 // later.
21 // TODO(dmichael): Really proxy this.
22 return PP_IMAGEDATAFORMAT_BGRA_PREMUL;
23 #elif defined(NACL_WIN64)
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.
26 NOTIMPLEMENTED();
27 return PP_IMAGEDATAFORMAT_BGRA_PREMUL;
28 #else
29 return PP_IMAGEDATAFORMAT_BGRA_PREMUL; if (SK_B32_SHIFT == 0)
19 return PP_IMAGEDATAFORMAT_BGRA_PREMUL; 30 return PP_IMAGEDATAFORMAT_BGRA_PREMUL;
20 else if (SK_R32_SHIFT == 0) 31 else if (SK_R32_SHIFT == 0)
21 return PP_IMAGEDATAFORMAT_RGBA_PREMUL; 32 return PP_IMAGEDATAFORMAT_RGBA_PREMUL;
22 else 33 else
23 return PP_IMAGEDATAFORMAT_BGRA_PREMUL; // Default to something on failure. 34 return PP_IMAGEDATAFORMAT_BGRA_PREMUL; // Default to something on failure.
24 #else
25 // In NaCl, just default to something. If we're wrong, it will be converted
26 // later.
27 // TODO(dmichael): Really proxy this.
28 return PP_IMAGEDATAFORMAT_BGRA_PREMUL;
29 #endif 35 #endif
30 } 36 }
31 37
32 // static 38 // static
33 bool PPB_ImageData_Shared::IsImageDataFormatSupported( 39 bool PPB_ImageData_Shared::IsImageDataFormatSupported(
34 PP_ImageDataFormat format) { 40 PP_ImageDataFormat format) {
35 return format == PP_IMAGEDATAFORMAT_BGRA_PREMUL || 41 return format == PP_IMAGEDATAFORMAT_BGRA_PREMUL ||
36 format == PP_IMAGEDATAFORMAT_RGBA_PREMUL; 42 format == PP_IMAGEDATAFORMAT_RGBA_PREMUL;
37 } 43 }
38 44
39 } // namespace ppapi 45 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/shared_impl/ppb_device_ref_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