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 "SkGpuDevice.h" | 8 #include "SkGpuDevice.h" |
9 | 9 |
10 #include "GrBlurUtils.h" | 10 #include "GrBlurUtils.h" |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 } | 389 } |
390 if (pts[0].fY == pts[1].fY) { | 390 if (pts[0].fY == pts[1].fY) { |
391 return ((int) pts[0].fY) != pts[0].fY; | 391 return ((int) pts[0].fY) != pts[0].fY; |
392 } | 392 } |
393 } | 393 } |
394 return true; | 394 return true; |
395 } | 395 } |
396 | 396 |
397 void SkGpuDevice::drawPoints(const SkDraw& draw, SkCanvas::PointMode mode, | 397 void SkGpuDevice::drawPoints(const SkDraw& draw, SkCanvas::PointMode mode, |
398 size_t count, const SkPoint pts[], const SkPaint& p
aint) { | 398 size_t count, const SkPoint pts[], const SkPaint& p
aint) { |
| 399 GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawPoints", fContext); |
399 CHECK_FOR_ANNOTATION(paint); | 400 CHECK_FOR_ANNOTATION(paint); |
400 CHECK_SHOULD_DRAW(draw); | 401 CHECK_SHOULD_DRAW(draw); |
401 | 402 |
402 SkScalar width = paint.getStrokeWidth(); | 403 SkScalar width = paint.getStrokeWidth(); |
403 if (width < 0) { | 404 if (width < 0) { |
404 return; | 405 return; |
405 } | 406 } |
406 | 407 |
407 if (paint.getPathEffect() && 2 == count && SkCanvas::kLines_PointMode == mod
e) { | 408 if (paint.getPathEffect() && 2 == count && SkCanvas::kLines_PointMode == mod
e) { |
408 GrStrokeInfo strokeInfo(paint, SkPaint::kStroke_Style); | 409 GrStrokeInfo strokeInfo(paint, SkPaint::kStroke_Style); |
(...skipping 1327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1736 | 1737 |
1737 /////////////////////////////////////////////////////////////////////////////// | 1738 /////////////////////////////////////////////////////////////////////////////// |
1738 | 1739 |
1739 bool SkGpuDevice::onShouldDisableLCD(const SkPaint& paint) const { | 1740 bool SkGpuDevice::onShouldDisableLCD(const SkPaint& paint) const { |
1740 return GrTextContext::ShouldDisableLCD(paint); | 1741 return GrTextContext::ShouldDisableLCD(paint); |
1741 } | 1742 } |
1742 | 1743 |
1743 void SkGpuDevice::flush() { | 1744 void SkGpuDevice::flush() { |
1744 DO_DEFERRED_CLEAR(); | 1745 DO_DEFERRED_CLEAR(); |
1745 fRenderTarget->prepareForExternalIO(); | 1746 fRenderTarget->prepareForExternalIO(); |
1746 | |
1747 // Clear batch debugging output | |
1748 if (GR_BATCH_DEBUGGING_OUTPUT) { | |
1749 SkDebugf("%s\n", fContext->getAuditTrail()->toJson().c_str()); | |
1750 GR_AUDIT_TRAIL_RESET(fContext->getAuditTrail()); | |
1751 } | |
1752 } | 1747 } |
1753 | 1748 |
1754 /////////////////////////////////////////////////////////////////////////////// | 1749 /////////////////////////////////////////////////////////////////////////////// |
1755 | 1750 |
1756 SkBaseDevice* SkGpuDevice::onCreateDevice(const CreateInfo& cinfo, const SkPaint
*) { | 1751 SkBaseDevice* SkGpuDevice::onCreateDevice(const CreateInfo& cinfo, const SkPaint
*) { |
1757 GrSurfaceDesc desc; | 1752 GrSurfaceDesc desc; |
1758 desc.fConfig = fRenderTarget->config(); | 1753 desc.fConfig = fRenderTarget->config(); |
1759 desc.fFlags = kRenderTarget_GrSurfaceFlag; | 1754 desc.fFlags = kRenderTarget_GrSurfaceFlag; |
1760 desc.fWidth = cinfo.fInfo.width(); | 1755 desc.fWidth = cinfo.fInfo.width(); |
1761 desc.fHeight = cinfo.fInfo.height(); | 1756 desc.fHeight = cinfo.fInfo.height(); |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1866 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); | 1861 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); |
1867 } | 1862 } |
1868 | 1863 |
1869 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { | 1864 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { |
1870 // We always return a transient cache, so it is freed after each | 1865 // We always return a transient cache, so it is freed after each |
1871 // filter traversal. | 1866 // filter traversal. |
1872 return SkGpuDevice::NewImageFilterCache(); | 1867 return SkGpuDevice::NewImageFilterCache(); |
1873 } | 1868 } |
1874 | 1869 |
1875 #endif | 1870 #endif |
OLD | NEW |