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

Unified Diff: ppapi/shared_impl/image_data_impl.cc

Issue 6282007: First pass at making the proxy handle multiple renderers. This associates the... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/shared_impl/image_data_impl.h ('k') | ppapi/tests/test_var_deprecated.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/shared_impl/image_data_impl.cc
===================================================================
--- ppapi/shared_impl/image_data_impl.cc (revision 0)
+++ ppapi/shared_impl/image_data_impl.cc (revision 0)
@@ -0,0 +1,29 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ppapi/shared_impl/image_data_impl.h"
+
+#include "skia/config/SkUserConfig.h"
+
+namespace pp {
+namespace shared_impl {
+
+// static
+PP_ImageDataFormat ImageDataImpl::GetNativeImageDataFormat() {
+ if (SK_B32_SHIFT == 0)
+ return PP_IMAGEDATAFORMAT_BGRA_PREMUL;
+ else if (SK_R32_SHIFT == 0)
+ return PP_IMAGEDATAFORMAT_RGBA_PREMUL;
+ else
+ return PP_IMAGEDATAFORMAT_BGRA_PREMUL; // Default to something on failure.
+}
+
+// static
+bool ImageDataImpl::IsImageDataFormatSupported(PP_ImageDataFormat format) {
+ return format == PP_IMAGEDATAFORMAT_BGRA_PREMUL ||
+ format == PP_IMAGEDATAFORMAT_RGBA_PREMUL;
+}
+
+} // namespace shared_impl
+} // namespace pp
Property changes on: ppapi/shared_impl/image_data_impl.cc
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « ppapi/shared_impl/image_data_impl.h ('k') | ppapi/tests/test_var_deprecated.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698