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

Unified Diff: ui/gfx/canvas_skia_linux.cc

Issue 7977025: aura: Make 'ui' buildable without gtk. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gfx/canvas_skia.h ('k') | ui/gfx/insets.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/canvas_skia_linux.cc
diff --git a/ui/gfx/canvas_skia_linux.cc b/ui/gfx/canvas_skia_linux.cc
index c5b95e0a6da1fda18ec17ed313931ee3ee22be32..882b381d9291965377f86e8961313f3760806287 100644
--- a/ui/gfx/canvas_skia_linux.cc
+++ b/ui/gfx/canvas_skia_linux.cc
@@ -7,19 +7,21 @@
#include <algorithm>
#include <cairo/cairo.h>
-#include <gtk/gtk.h>
#include <pango/pango.h>
#include <pango/pangocairo.h>
#include "base/i18n/rtl.h"
#include "base/logging.h"
#include "ui/gfx/font.h"
-#include "ui/gfx/gtk_util.h"
#include "ui/gfx/pango_util.h"
-#include "ui/gfx/platform_font_gtk.h"
+#include "ui/gfx/platform_font_pango.h"
#include "ui/gfx/rect.h"
#include "ui/gfx/skia_util.h"
+#if defined(TOOLKIT_USES_GTK)
+#include <gdk/gdk.h>
+#endif
+
using std::max;
namespace {
@@ -219,8 +221,8 @@ void DrawStringContext::DrawWithHalo(const SkColor& text_color,
}
void DrawStringContext::DrawUnderline(cairo_t* cr, double extra_edge_width) {
- gfx::PlatformFontGtk* platform_font =
- static_cast<gfx::PlatformFontGtk*>(font_.platform_font());
+ gfx::PlatformFontPango* platform_font =
+ static_cast<gfx::PlatformFontPango*>(font_.platform_font());
const double underline_y =
static_cast<double>(text_y_) + text_height_ +
platform_font->underline_position();
@@ -267,8 +269,8 @@ void CanvasSkia::SizeStringInt(const string16& text,
pango_layout_get_pixel_size(layout, width, height);
if (font.GetStyle() & gfx::Font::UNDERLINED) {
- gfx::PlatformFontGtk* platform_font =
- static_cast<gfx::PlatformFontGtk*>(font.platform_font());
+ gfx::PlatformFontPango* platform_font =
+ static_cast<gfx::PlatformFontPango*>(font.platform_font());
*height += max(platform_font->underline_position() +
platform_font->underline_thickness(), 0.0);
}
@@ -329,6 +331,7 @@ void CanvasSkia::DrawStringInt(const string16& text,
context.Draw(color);
}
+#if defined(TOOLKIT_USES_GTK)
void CanvasSkia::DrawGdkPixbuf(GdkPixbuf* pixbuf, int x, int y) {
if (!pixbuf) {
NOTREACHED();
@@ -340,6 +343,7 @@ void CanvasSkia::DrawGdkPixbuf(GdkPixbuf* pixbuf, int x, int y) {
gdk_cairo_set_source_pixbuf(cr, pixbuf, x, y);
cairo_paint(cr);
}
+#endif // defined(TOOLKIT_USES_GTK)
ui::TextureID CanvasSkia::GetTextureID() {
// TODO(wjmaclean)
« no previous file with comments | « ui/gfx/canvas_skia.h ('k') | ui/gfx/insets.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698