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

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: some missed intstuff Created 8 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/font_atlas.h ('k') | cc/geometry.h » ('j') | cc/layer_quad.h » ('J')
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 d8294da8276076af6c7872eccb2b1d2cf6babe4a..1e0e9493944062963555b5b43838a8bd214c77ea 100644
--- a/cc/font_atlas.cc
+++ b/cc/font_atlas.cc
@@ -11,13 +11,12 @@
#include "base/string_split.h"
#include "cc/proxy.h"
#include "third_party/skia/include/core/SkCanvas.h"
-#include "ui/gfx/point.h"
namespace cc {
using namespace std;
-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)
{
@@ -29,7 +28,7 @@ FontAtlas::~FontAtlas()
{
}
-void FontAtlas::drawText(SkCanvas* canvas, const SkPaint& paint, const std::string& text, const gfx::Point& destPosition, const IntSize& clip) const
+void FontAtlas::drawText(SkCanvas* canvas, const SkPaint& paint, const std::string& text, const gfx::Point& destPosition, const gfx::Size& clip) const
{
DCHECK(Proxy::isImplThread());
@@ -53,7 +52,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') | cc/layer_quad.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698