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

Side by Side Diff: Source/WebCore/platform/graphics/skia/SkiaFontWin.cpp

Issue 7520031: Merge 91768 - [SKIA] Make the skia GL context current when drawing text to gpu backed platform co... (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/835/
Patch Set: Created 9 years, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2008, Google Inc. All rights reserved. 2 * Copyright (c) 2008, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 const GOFFSET* offsets, 184 const GOFFSET* offsets,
185 const SkPoint* origin) 185 const SkPoint* origin)
186 { 186 {
187 HDC dc = GetDC(0); 187 HDC dc = GetDC(0);
188 HGDIOBJ oldFont = SelectObject(dc, hfont); 188 HGDIOBJ oldFont = SelectObject(dc, hfont);
189 189
190 PlatformContextSkia* platformContext = context->platformContext(); 190 PlatformContextSkia* platformContext = context->platformContext();
191 SkCanvas* canvas = platformContext->canvas(); 191 SkCanvas* canvas = platformContext->canvas();
192 TextDrawingModeFlags textMode = platformContext->getTextDrawingMode(); 192 TextDrawingModeFlags textMode = platformContext->getTextDrawingMode();
193 193
194 // If platformContext is GPU-backed make its GL context current.
195 platformContext->makeGrContextCurrent();
196
194 // Filling (if necessary). This is the common case. 197 // Filling (if necessary). This is the common case.
195 SkPaint paint; 198 SkPaint paint;
196 platformContext->setupPaintForFilling(&paint); 199 platformContext->setupPaintForFilling(&paint);
197 paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding); 200 paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
198 setupPaintForFont(hfont, &paint, platformContext); 201 setupPaintForFont(hfont, &paint, platformContext);
199 202
200 bool didFill = false; 203 bool didFill = false;
201 204
202 if ((textMode & TextModeFill) && (SkColorGetA(paint.getColor()) || paint.get Looper())) { 205 if ((textMode & TextModeFill) && (SkColorGetA(paint.getColor()) || paint.get Looper())) {
203 skiaDrawText(canvas, *origin, &paint, &glyphs[0], &advances[0], &offsets [0], numGlyphs); 206 skiaDrawText(canvas, *origin, &paint, &glyphs[0], &advances[0], &offsets [0], numGlyphs);
(...skipping 24 matching lines...) Expand all
228 } 231 }
229 232
230 skiaDrawText(canvas, *origin, &paint, &glyphs[0], &advances[0], &offsets [0], numGlyphs); 233 skiaDrawText(canvas, *origin, &paint, &glyphs[0], &advances[0], &offsets [0], numGlyphs);
231 } 234 }
232 235
233 SelectObject(dc, oldFont); 236 SelectObject(dc, oldFont);
234 ReleaseDC(0, dc); 237 ReleaseDC(0, dc);
235 } 238 }
236 239
237 } // namespace WebCore 240 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698