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

Side by Side Diff: Source/web/WebFontImpl.cpp

Issue 398673003: Rename WebCore namespace to blink in bindings and web (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « Source/web/WebFontImpl.h ('k') | Source/web/WebFormControlElement.cpp » ('j') | 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) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 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 24 matching lines...) Expand all
35 #include "platform/fonts/FontDescription.h" 35 #include "platform/fonts/FontDescription.h"
36 #include "platform/graphics/GraphicsContext.h" 36 #include "platform/graphics/GraphicsContext.h"
37 #include "platform/text/TextRun.h" 37 #include "platform/text/TextRun.h"
38 #include "public/platform/WebFloatPoint.h" 38 #include "public/platform/WebFloatPoint.h"
39 #include "public/platform/WebFloatRect.h" 39 #include "public/platform/WebFloatRect.h"
40 #include "public/platform/WebRect.h" 40 #include "public/platform/WebRect.h"
41 #include "public/web/WebFontDescription.h" 41 #include "public/web/WebFontDescription.h"
42 #include "public/web/WebTextRun.h" 42 #include "public/web/WebTextRun.h"
43 #include <skia/ext/platform_canvas.h> 43 #include <skia/ext/platform_canvas.h>
44 44
45 using namespace WebCore; 45 using namespace blink;
46 46
47 namespace blink { 47 namespace blink {
48 48
49 WebFont* WebFont::create(const WebFontDescription& desc) 49 WebFont* WebFont::create(const WebFontDescription& desc)
50 { 50 {
51 return new WebFontImpl(desc); 51 return new WebFontImpl(desc);
52 } 52 }
53 53
54 WebFontImpl::WebFontImpl(const FontDescription& desc) 54 WebFontImpl::WebFontImpl(const FontDescription& desc)
55 : m_font(desc) 55 : m_font(desc)
(...skipping 29 matching lines...) Expand all
85 float WebFontImpl::xHeight() const 85 float WebFontImpl::xHeight() const
86 { 86 {
87 return m_font.fontMetrics().xHeight(); 87 return m_font.fontMetrics().xHeight();
88 } 88 }
89 89
90 void WebFontImpl::drawText(WebCanvas* canvas, const WebTextRun& run, const WebFl oatPoint& leftBaseline, 90 void WebFontImpl::drawText(WebCanvas* canvas, const WebTextRun& run, const WebFl oatPoint& leftBaseline,
91 WebColor color, const WebRect& clip, bool canvasIsOpa que, 91 WebColor color, const WebRect& clip, bool canvasIsOpa que,
92 int from, int to) const 92 int from, int to) const
93 { 93 {
94 FontCachePurgePreventer fontCachePurgePreventer; 94 FontCachePurgePreventer fontCachePurgePreventer;
95 WebCore::FloatRect textClipRect(clip); 95 blink::FloatRect textClipRect(clip);
96 TextRun textRun(run); 96 TextRun textRun(run);
97 TextRunPaintInfo runInfo(textRun); 97 TextRunPaintInfo runInfo(textRun);
98 runInfo.from = from; 98 runInfo.from = from;
99 runInfo.to = to == -1 ? textRun.length() : to; 99 runInfo.to = to == -1 ? textRun.length() : to;
100 runInfo.bounds = textClipRect; 100 runInfo.bounds = textClipRect;
101 GraphicsContext gc(canvas); 101 GraphicsContext gc(canvas);
102 102
103 gc.save(); 103 gc.save();
104 gc.setCertainlyOpaque(canvasIsOpaque); 104 gc.setCertainlyOpaque(canvasIsOpaque);
105 gc.setFillColor(color); 105 gc.setFillColor(color);
(...skipping 14 matching lines...) Expand all
120 return m_font.offsetForPosition(run, position, true); 120 return m_font.offsetForPosition(run, position, true);
121 } 121 }
122 122
123 WebFloatRect WebFontImpl::selectionRectForText(const WebTextRun& run, const WebF loatPoint& leftBaseline, int height, int from, int to) const 123 WebFloatRect WebFontImpl::selectionRectForText(const WebTextRun& run, const WebF loatPoint& leftBaseline, int height, int from, int to) const
124 { 124 {
125 FontCachePurgePreventer fontCachePurgePreventer; 125 FontCachePurgePreventer fontCachePurgePreventer;
126 return m_font.selectionRectForText(run, leftBaseline, height, from, to); 126 return m_font.selectionRectForText(run, leftBaseline, height, from, to);
127 } 127 }
128 128
129 } // namespace blink 129 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/WebFontImpl.h ('k') | Source/web/WebFormControlElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698