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

Unified Diff: src/core/SkPaint.cpp

Issue 15896004: Move SkDrawLooper implementation to its own file. (Closed) Base URL: http://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 7 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 | « src/core/SkDrawLooper.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPaint.cpp
diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp
index c7cbce18c77e48f3f864dd91446b8be82cfedd87..f67395970bc6615981db995a99c6e1adabc97eb9 100644
--- a/src/core/SkPaint.cpp
+++ b/src/core/SkPaint.cpp
@@ -2552,51 +2552,3 @@ bool SkPaint::nothingToDraw() const {
}
return false;
}
-
-
-//////////// Move these to their own file soon.
-
-SK_DEFINE_INST_COUNT(SkDrawLooper)
-
-bool SkDrawLooper::canComputeFastBounds(const SkPaint& paint) {
- SkCanvas canvas;
-
- this->init(&canvas);
- for (;;) {
- SkPaint p(paint);
- if (this->next(&canvas, &p)) {
- p.setLooper(NULL);
- if (!p.canComputeFastBounds()) {
- return false;
- }
- } else {
- break;
- }
- }
- return true;
-}
-
-void SkDrawLooper::computeFastBounds(const SkPaint& paint, const SkRect& src,
- SkRect* dst) {
- SkCanvas canvas;
-
- this->init(&canvas);
- for (bool firstTime = true;; firstTime = false) {
- SkPaint p(paint);
- if (this->next(&canvas, &p)) {
- SkRect r(src);
-
- p.setLooper(NULL);
- p.computeFastBounds(r, &r);
- canvas.getTotalMatrix().mapRect(&r);
-
- if (firstTime) {
- *dst = r;
- } else {
- dst->join(r);
- }
- } else {
- break;
- }
- }
-}
« no previous file with comments | « src/core/SkDrawLooper.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698