summaryrefslogtreecommitdiffstats
path: root/ui/gfx
diff options
context:
space:
mode:
authorreveman@google.com <reveman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-16 20:53:31 +0000
committerreveman@google.com <reveman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-16 20:53:31 +0000
commit4d391dff54de91519d4f70951a8ab50f7a4b8bbf (patch)
tree61f172e614cd578fc2f68bf2c8ee4b924dcddb28 /ui/gfx
parentb37bdfe502acc486794643fb856fb715ffd2b22a (diff)
downloadchromium_src-4d391dff54de91519d4f70951a8ab50f7a4b8bbf.zip
chromium_src-4d391dff54de91519d4f70951a8ab50f7a4b8bbf.tar.gz
chromium_src-4d391dff54de91519d4f70951a8ab50f7a4b8bbf.tar.bz2
Avoid using skia::ScopedPlatformPaint in RenderTextLinux::EnsureLayout(). This allows RenderTextLinux to be used for rendering to platform independent canvas.
BUG=111587 TEST=none Review URL: https://chromiumcodereview.appspot.com/9665011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@127227 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx')
-rw-r--r--ui/gfx/render_text_linux.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/ui/gfx/render_text_linux.cc b/ui/gfx/render_text_linux.cc
index da63caa..4345652 100644
--- a/ui/gfx/render_text_linux.cc
+++ b/ui/gfx/render_text_linux.cc
@@ -242,11 +242,13 @@ void RenderTextLinux::ResetLayout() {
void RenderTextLinux::EnsureLayout() {
if (layout_ == NULL) {
- Canvas canvas(display_rect().size(), false);
- skia::ScopedPlatformPaint scoped_platform_paint(canvas.sk_canvas());
- cairo_t* cr = scoped_platform_paint.GetPlatformSurface();
+ cairo_surface_t* surface =
+ cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 0, 0);
+ cairo_t* cr = cairo_create(surface);
layout_ = pango_cairo_create_layout(cr);
+ cairo_destroy(cr);
+ cairo_surface_destroy(surface);
SetupPangoLayoutWithFontDescription(
layout_,
GetDisplayText(),