diff options
author | beng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-15 00:05:37 +0000 |
---|---|---|
committer | beng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-15 00:05:37 +0000 |
commit | 7a91641fa8e7f0416ec848a9c7c81cbc9f605368 (patch) | |
tree | 102c2faf69648fdf7dd808b62c3367d21a0b2ae6 /app/gfx | |
parent | 7a176b8a3e342f4bba7ceda6502bc2a3ce51fd6f (diff) | |
download | chromium_src-7a91641fa8e7f0416ec848a9c7c81cbc9f605368.zip chromium_src-7a91641fa8e7f0416ec848a9c7c81cbc9f605368.tar.gz chromium_src-7a91641fa8e7f0416ec848a9c7c81cbc9f605368.tar.bz2 |
fix my retardation and the build
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16129 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app/gfx')
-rw-r--r-- | app/gfx/gtk_util.cc | 41 | ||||
-rw-r--r-- | app/gfx/gtk_util.h | 21 |
2 files changed, 0 insertions, 62 deletions
diff --git a/app/gfx/gtk_util.cc b/app/gfx/gtk_util.cc index 391bd27..e2c5ba4 100644 --- a/app/gfx/gtk_util.cc +++ b/app/gfx/gtk_util.cc @@ -39,44 +39,3 @@ GdkPixbuf* GdkPixbufFromSkBitmap(const SkBitmap* bitmap) { } } // namespace gfx -// Copyright (c) 2009 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 "app/gfx/gtk_util.h" - -#include "base/linux_util.h" -#include "third_party/skia/include/core/SkBitmap.h" - -namespace { - -void FreePixels(guchar* pixels, gpointer data) { - free(data); -} - -} // namespace - -namespace gfx { - -GdkPixbuf* GdkPixbufFromSkBitmap(const SkBitmap* bitmap) { - bitmap->lockPixels(); - int width = bitmap->width(); - int height = bitmap->height(); - int stride = bitmap->rowBytes(); - const guchar* orig_data = static_cast<guchar*>(bitmap->getPixels()); - guchar* data = base::BGRAToRGBA(orig_data, width, height, stride); - - // This pixbuf takes ownership of our malloc()ed data and will - // free it for us when it is destroyed. - GdkPixbuf* pixbuf = gdk_pixbuf_new_from_data( - data, - GDK_COLORSPACE_RGB, // The only colorspace gtk supports. - true, // There is an alpha channel. - 8, - width, height, stride, &FreePixels, data); - - bitmap->unlockPixels(); - return pixbuf; -} - -} // namespace gfx diff --git a/app/gfx/gtk_util.h b/app/gfx/gtk_util.h index 4bba2ca..471d7f2 100644 --- a/app/gfx/gtk_util.h +++ b/app/gfx/gtk_util.h @@ -19,24 +19,3 @@ GdkPixbuf* GdkPixbufFromSkBitmap(const SkBitmap* bitmap); } // namespace gfx #endif // APP_GFX_GTK_UTIL_H_ -// Copyright (c) 2009 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. - -#ifndef APP_GFX_GTK_UTIL_H_ -#define APP_GFX_GTK_UTIL_H_ - -#include <gtk/gtk.h> - -typedef struct _GdkPixbuf GdkPixbuf; -class SkBitmap; - -namespace gfx { - -// Convert and copy a SkBitmap to a GdkPixbuf. NOTE: this uses BGRAToRGBA, so -// it is an expensive operation. -GdkPixbuf* GdkPixbufFromSkBitmap(const SkBitmap* bitmap); - -} // namespace gfx - -#endif // APP_GFX_GTK_UTIL_H_ |