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: ppapi/shared_impl/ppb_image_data_shared.cc

Issue 10837145: Add gpu targets to untrusted build, and add Graphics3D code to untrusted build. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 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 "build/build_config.h"
8
9 #if !defined(OS_NACL)
7 #include "third_party/skia/include/core/SkTypes.h" 10 #include "third_party/skia/include/core/SkTypes.h"
11 #endif
8 12
9 namespace ppapi { 13 namespace ppapi {
10 14
11 // static 15 // static
12 PP_ImageDataFormat PPB_ImageData_Shared::GetNativeImageDataFormat() { 16 PP_ImageDataFormat PPB_ImageData_Shared::GetNativeImageDataFormat() {
17 #if !defined(OS_NACL)
13 if (SK_B32_SHIFT == 0) 18 if (SK_B32_SHIFT == 0)
14 return PP_IMAGEDATAFORMAT_BGRA_PREMUL; 19 return PP_IMAGEDATAFORMAT_BGRA_PREMUL;
15 else if (SK_R32_SHIFT == 0) 20 else if (SK_R32_SHIFT == 0)
16 return PP_IMAGEDATAFORMAT_RGBA_PREMUL; 21 return PP_IMAGEDATAFORMAT_RGBA_PREMUL;
17 else 22 else
18 return PP_IMAGEDATAFORMAT_BGRA_PREMUL; // Default to something on failure. 23 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
19 } 30 }
20 31
21 // static 32 // static
22 bool PPB_ImageData_Shared::IsImageDataFormatSupported( 33 bool PPB_ImageData_Shared::IsImageDataFormatSupported(
23 PP_ImageDataFormat format) { 34 PP_ImageDataFormat format) {
24 return format == PP_IMAGEDATAFORMAT_BGRA_PREMUL || 35 return format == PP_IMAGEDATAFORMAT_BGRA_PREMUL ||
25 format == PP_IMAGEDATAFORMAT_RGBA_PREMUL; 36 format == PP_IMAGEDATAFORMAT_RGBA_PREMUL;
26 } 37 }
27 38
28 } // namespace ppapi 39 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698