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

Unified Diff: cc/font_atlas.cc

Issue 11264056: cc: Use gfx:: Geometry types for positions, bounds, and related things. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ScaleAsVector Created 8 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/font_atlas.h ('k') | cc/geometry.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/font_atlas.cc
diff --git a/cc/font_atlas.cc b/cc/font_atlas.cc
index 5d63d49f335e3af077ae07aed80abd76f859f99b..2d157663b22005047e8bd872bf98cd818dd81eaa 100644
--- a/cc/font_atlas.cc
+++ b/cc/font_atlas.cc
@@ -11,12 +11,10 @@
#include "base/string_split.h"
#include "cc/proxy.h"
#include "third_party/skia/include/core/SkCanvas.h"
-#include "ui/gfx/point.h"
-#include "ui/gfx/size.h"
namespace cc {
-FontAtlas::FontAtlas(SkBitmap bitmap, IntRect asciiToRectTable[128], int fontHeight)
+FontAtlas::FontAtlas(SkBitmap bitmap, gfx::Rect asciiToRectTable[128], int fontHeight)
: m_atlas(bitmap)
, m_fontHeight(fontHeight)
{
@@ -52,7 +50,7 @@ void FontAtlas::drawOneLineOfTextInternal(SkCanvas* canvas, const SkPaint& paint
for (unsigned i = 0; i < textLine.length(); ++i) {
// If the ASCII code is out of bounds, then index 0 is used, which is just a plain rectangle glyph.
int asciiIndex = (textLine[i] < 128) ? textLine[i] : 0;
- IntRect glyphBounds = m_asciiToRectTable[asciiIndex];
+ gfx::Rect glyphBounds = m_asciiToRectTable[asciiIndex];
SkIRect source = SkIRect::MakeXYWH(glyphBounds.x(), glyphBounds.y(), glyphBounds.width(), glyphBounds.height());
canvas->drawBitmapRect(m_atlas, &source, SkRect::MakeXYWH(position.x(), position.y(), glyphBounds.width(), glyphBounds.height()), &paint);
position.set_x(position.x() + glyphBounds.width());
« no previous file with comments | « cc/font_atlas.h ('k') | cc/geometry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698