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

Unified Diff: gfx/canvas_skia.cc

Issue 2959014: Implement initial ClipRect.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gfx/canvas_skia.h ('k') | views/border.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gfx/canvas_skia.cc
===================================================================
--- gfx/canvas_skia.cc (revision 53197)
+++ gfx/canvas_skia.cc (working copy)
@@ -18,6 +18,16 @@
namespace gfx {
+////////////////////////////////////////////////////////////////////////////////
+// CanvasSkia, public:
+
+// static
+int CanvasSkia::DefaultCanvasTextAlignment() {
+ if (!base::i18n::IsRTL())
+ return gfx::Canvas::TEXT_ALIGN_LEFT;
+ return gfx::Canvas::TEXT_ALIGN_RIGHT;
+}
+
SkBitmap CanvasSkia::ExtractBitmap() const {
const SkBitmap& device_bitmap = getDevice()->accessBitmap(false);
@@ -54,19 +64,6 @@
restore();
}
-bool CanvasSkia::GetClipRect(gfx::Rect* r) {
- SkRect clip;
- if (!getClipBounds(&clip)) {
- if (r)
- r->SetRect(0, 0, 0, 0);
- return false;
- }
- r->SetRect(SkScalarRound(clip.fLeft), SkScalarRound(clip.fTop),
- SkScalarRound(clip.fRight - clip.fLeft),
- SkScalarRound(clip.fBottom - clip.fTop));
- return true;
-}
-
bool CanvasSkia::ClipRectInt(int x, int y, int w, int h) {
SkRect new_clip;
new_clip.set(SkIntToScalar(x), SkIntToScalar(y),
@@ -74,13 +71,6 @@
return clipRect(new_clip);
}
-bool CanvasSkia::IntersectsClipRectInt(int x, int y, int w, int h) {
- SkRect clip;
- return getClipBounds(&clip) &&
- clip.intersect(SkIntToScalar(x), SkIntToScalar(y), SkIntToScalar(x + w),
- SkIntToScalar(y + h));
-}
-
void CanvasSkia::TranslateInt(int x, int y) {
translate(SkIntToScalar(x), SkIntToScalar(y));
}
@@ -314,11 +304,14 @@
return this;
}
-// static
-int CanvasSkia::DefaultCanvasTextAlignment() {
- if (!base::i18n::IsRTL())
- return gfx::Canvas::TEXT_ALIGN_LEFT;
- return gfx::Canvas::TEXT_ALIGN_RIGHT;
+////////////////////////////////////////////////////////////////////////////////
+// CanvasSkia, private:
+
+bool CanvasSkia::IntersectsClipRectInt(int x, int y, int w, int h) {
+ SkRect clip;
+ return getClipBounds(&clip) &&
+ clip.intersect(SkIntToScalar(x), SkIntToScalar(y), SkIntToScalar(x + w),
+ SkIntToScalar(y + h));
}
////////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « gfx/canvas_skia.h ('k') | views/border.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698