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

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

Issue 468083003: Cleanup namespace usage in Source/web/Web[A-H]*.cpp (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebasing Created 6 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 | « Source/web/WebFontDescription.cpp ('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 blink;
46
47 namespace blink { 45 namespace blink {
48 46
49 WebFont* WebFont::create(const WebFontDescription& desc) 47 WebFont* WebFont::create(const WebFontDescription& desc)
50 { 48 {
51 return new WebFontImpl(desc); 49 return new WebFontImpl(desc);
52 } 50 }
53 51
54 WebFontImpl::WebFontImpl(const FontDescription& desc) 52 WebFontImpl::WebFontImpl(const FontDescription& desc)
55 : m_font(desc) 53 : m_font(desc)
56 { 54 {
(...skipping 28 matching lines...) Expand all
85 float WebFontImpl::xHeight() const 83 float WebFontImpl::xHeight() const
86 { 84 {
87 return m_font.fontMetrics().xHeight(); 85 return m_font.fontMetrics().xHeight();
88 } 86 }
89 87
90 void WebFontImpl::drawText(WebCanvas* canvas, const WebTextRun& run, const WebFl oatPoint& leftBaseline, 88 void WebFontImpl::drawText(WebCanvas* canvas, const WebTextRun& run, const WebFl oatPoint& leftBaseline,
91 WebColor color, const WebRect& clip, bool canvasIsOpa que, 89 WebColor color, const WebRect& clip, bool canvasIsOpa que,
92 int from, int to) const 90 int from, int to) const
93 { 91 {
94 FontCachePurgePreventer fontCachePurgePreventer; 92 FontCachePurgePreventer fontCachePurgePreventer;
95 blink::FloatRect textClipRect(clip); 93 FloatRect textClipRect(clip);
96 TextRun textRun(run); 94 TextRun textRun(run);
97 TextRunPaintInfo runInfo(textRun); 95 TextRunPaintInfo runInfo(textRun);
98 runInfo.from = from; 96 runInfo.from = from;
99 runInfo.to = to == -1 ? textRun.length() : to; 97 runInfo.to = to == -1 ? textRun.length() : to;
100 runInfo.bounds = textClipRect; 98 runInfo.bounds = textClipRect;
101 GraphicsContext gc(canvas); 99 GraphicsContext gc(canvas);
102 100
103 gc.save(); 101 gc.save();
104 gc.setCertainlyOpaque(canvasIsOpaque); 102 gc.setCertainlyOpaque(canvasIsOpaque);
105 gc.setFillColor(color); 103 gc.setFillColor(color);
(...skipping 14 matching lines...) Expand all
120 return m_font.offsetForPosition(run, position, true); 118 return m_font.offsetForPosition(run, position, true);
121 } 119 }
122 120
123 WebFloatRect WebFontImpl::selectionRectForText(const WebTextRun& run, const WebF loatPoint& leftBaseline, int height, int from, int to) const 121 WebFloatRect WebFontImpl::selectionRectForText(const WebTextRun& run, const WebF loatPoint& leftBaseline, int height, int from, int to) const
124 { 122 {
125 FontCachePurgePreventer fontCachePurgePreventer; 123 FontCachePurgePreventer fontCachePurgePreventer;
126 return m_font.selectionRectForText(run, leftBaseline, height, from, to); 124 return m_font.selectionRectForText(run, leftBaseline, height, from, to);
127 } 125 }
128 126
129 } // namespace blink 127 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/WebFontDescription.cpp ('k') | Source/web/WebFormControlElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698