OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "ui/gfx/canvas_skia.h" | 5 #include "ui/gfx/canvas_skia.h" |
6 | 6 |
7 #include <cairo/cairo.h> | 7 #include <cairo/cairo.h> |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 #include <pango/pango.h> | 9 #include <pango/pango.h> |
10 #include <pango/pangocairo.h> | 10 #include <pango/pangocairo.h> |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 cairo_set_source_rgba(text_cr, | 284 cairo_set_source_rgba(text_cr, |
285 SkColorGetR(text_color) / 255.0, | 285 SkColorGetR(text_color) / 255.0, |
286 SkColorGetG(text_color) / 255.0, | 286 SkColorGetG(text_color) / 255.0, |
287 SkColorGetB(text_color) / 255.0, | 287 SkColorGetB(text_color) / 255.0, |
288 SkColorGetA(text_color) / 255.0); | 288 SkColorGetA(text_color) / 255.0); |
289 cairo_fill(text_cr); | 289 cairo_fill(text_cr); |
290 | 290 |
291 text_canvas.endPlatformPaint(); | 291 text_canvas.endPlatformPaint(); |
292 | 292 |
293 const SkBitmap& text_bitmap = const_cast<SkBitmap&>( | 293 const SkBitmap& text_bitmap = const_cast<SkBitmap&>( |
294 text_canvas.getTopPlatformDevice().accessBitmap(false)); | 294 text_canvas.getTopDevice().accessBitmap(false)); |
295 canvas_->DrawBitmapInt(text_bitmap, text_x_ - 1, text_y_ - 1); | 295 canvas_->DrawBitmapInt(text_bitmap, text_x_ - 1, text_y_ - 1); |
296 } | 296 } |
297 | 297 |
298 } // namespace | 298 } // namespace |
299 | 299 |
300 namespace gfx { | 300 namespace gfx { |
301 | 301 |
302 CanvasSkia::CanvasSkia(int width, int height, bool is_opaque) | 302 CanvasSkia::CanvasSkia(int width, int height, bool is_opaque) |
303 : skia::PlatformCanvas(width, height, is_opaque) { | 303 : skia::PlatformCanvas(width, height, is_opaque) { |
304 } | 304 } |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 gdk_cairo_set_source_pixbuf(cr, pixbuf, x, y); | 383 gdk_cairo_set_source_pixbuf(cr, pixbuf, x, y); |
384 cairo_paint(cr); | 384 cairo_paint(cr); |
385 } | 385 } |
386 | 386 |
387 ui::TextureID CanvasSkia::GetTextureID() { | 387 ui::TextureID CanvasSkia::GetTextureID() { |
388 // TODO(wjmaclean) | 388 // TODO(wjmaclean) |
389 return 0; | 389 return 0; |
390 } | 390 } |
391 | 391 |
392 } // namespace gfx | 392 } // namespace gfx |
OLD | NEW |