| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "SkColorFilter.h" | 8 #include "SkColorFilter.h" |
| 9 #include "SkDevice.h" | 9 #include "SkDevice.h" |
| 10 #include "SkDraw.h" | 10 #include "SkDraw.h" |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 void SkBaseDevice::drawBitmapNine(const SkDraw& draw, const SkBitmap& bitmap, co
nst SkIRect& center, | 178 void SkBaseDevice::drawBitmapNine(const SkDraw& draw, const SkBitmap& bitmap, co
nst SkIRect& center, |
| 179 const SkRect& dst, const SkPaint& paint) { | 179 const SkRect& dst, const SkPaint& paint) { |
| 180 SkNinePatchIter iter(bitmap.width(), bitmap.height(), center, dst); | 180 SkNinePatchIter iter(bitmap.width(), bitmap.height(), center, dst); |
| 181 | 181 |
| 182 SkRect srcR, dstR; | 182 SkRect srcR, dstR; |
| 183 while (iter.next(&srcR, &dstR)) { | 183 while (iter.next(&srcR, &dstR)) { |
| 184 this->drawBitmapRect(draw, bitmap, &srcR, dstR, paint, SkCanvas::kStrict
_SrcRectConstraint); | 184 this->drawBitmapRect(draw, bitmap, &srcR, dstR, paint, SkCanvas::kStrict
_SrcRectConstraint); |
| 185 } | 185 } |
| 186 } | 186 } |
| 187 | 187 |
| 188 void SkBaseDevice::drawBitmapNine(const SkDraw& draw, const SkBitmap& bitmap, |
| 189 const SkCanvas::NinePatchDivs& divs, const SkR
ect& dst, |
| 190 const SkPaint& paint) { |
| 191 SkNinePatchIter iter(bitmap.width(), bitmap.height(), divs, dst); |
| 192 |
| 193 SkRect srcR, dstR; |
| 194 while (iter.next(&srcR, &dstR)) { |
| 195 this->drawBitmapRect(draw, bitmap, &srcR, dstR, paint, SkCanvas::kStrict
_SrcRectConstraint); |
| 196 } |
| 197 } |
| 198 |
| 188 void SkBaseDevice::drawAtlas(const SkDraw& draw, const SkImage* atlas, const SkR
SXform xform[], | 199 void SkBaseDevice::drawAtlas(const SkDraw& draw, const SkImage* atlas, const SkR
SXform xform[], |
| 189 const SkRect tex[], const SkColor colors[], int cou
nt, | 200 const SkRect tex[], const SkColor colors[], int cou
nt, |
| 190 SkXfermode::Mode mode, const SkPaint& paint) { | 201 SkXfermode::Mode mode, const SkPaint& paint) { |
| 191 SkPath path; | 202 SkPath path; |
| 192 path.setIsVolatile(true); | 203 path.setIsVolatile(true); |
| 193 | 204 |
| 194 for (int i = 0; i < count; ++i) { | 205 for (int i = 0; i < count; ++i) { |
| 195 SkPoint quad[4]; | 206 SkPoint quad[4]; |
| 196 xform[i].toQuad(tex[i].width(), tex[i].height(), quad); | 207 xform[i].toQuad(tex[i].width(), tex[i].height(), quad); |
| 197 | 208 |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 544 | 555 |
| 545 // Also log filter quality independent scale factor. | 556 // Also log filter quality independent scale factor. |
| 546 SK_HISTOGRAM_ENUMERATION("DrawScaleFactor.AnyFilterQuality", scaleFactor, | 557 SK_HISTOGRAM_ENUMERATION("DrawScaleFactor.AnyFilterQuality", scaleFactor, |
| 547 kLast_ScaleFactor + 1); | 558 kLast_ScaleFactor + 1); |
| 548 | 559 |
| 549 // Also log an overall histogram of filter quality. | 560 // Also log an overall histogram of filter quality. |
| 550 SK_HISTOGRAM_ENUMERATION("FilterQuality", filterQuality, kLast_SkFilterQuali
ty + 1); | 561 SK_HISTOGRAM_ENUMERATION("FilterQuality", filterQuality, kLast_SkFilterQuali
ty + 1); |
| 551 #endif | 562 #endif |
| 552 } | 563 } |
| 553 | 564 |
| OLD | NEW |