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 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 if (pts[0].fY == pts[1].fY) { | 404 if (pts[0].fY == pts[1].fY) { |
405 return ((int) pts[0].fY) != pts[0].fY; | 405 return ((int) pts[0].fY) != pts[0].fY; |
406 } | 406 } |
407 } | 407 } |
408 return true; | 408 return true; |
409 } | 409 } |
410 | 410 |
411 void SkGpuDevice::drawPoints(const SkDraw& draw, SkCanvas::PointMode mode, | 411 void SkGpuDevice::drawPoints(const SkDraw& draw, SkCanvas::PointMode mode, |
412 size_t count, const SkPoint pts[], const SkPaint& p
aint) { | 412 size_t count, const SkPoint pts[], const SkPaint& p
aint) { |
413 ASSERT_SINGLE_OWNER | 413 ASSERT_SINGLE_OWNER |
| 414 GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawPoints", fContext); |
414 CHECK_FOR_ANNOTATION(paint); | 415 CHECK_FOR_ANNOTATION(paint); |
415 CHECK_SHOULD_DRAW(draw); | 416 CHECK_SHOULD_DRAW(draw); |
416 | 417 |
417 SkScalar width = paint.getStrokeWidth(); | 418 SkScalar width = paint.getStrokeWidth(); |
418 if (width < 0) { | 419 if (width < 0) { |
419 return; | 420 return; |
420 } | 421 } |
421 | 422 |
422 if (paint.getPathEffect() && 2 == count && SkCanvas::kLines_PointMode == mod
e) { | 423 if (paint.getPathEffect() && 2 == count && SkCanvas::kLines_PointMode == mod
e) { |
423 GrStrokeInfo strokeInfo(paint, SkPaint::kStroke_Style); | 424 GrStrokeInfo strokeInfo(paint, SkPaint::kStroke_Style); |
(...skipping 1353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1777 /////////////////////////////////////////////////////////////////////////////// | 1778 /////////////////////////////////////////////////////////////////////////////// |
1778 | 1779 |
1779 bool SkGpuDevice::onShouldDisableLCD(const SkPaint& paint) const { | 1780 bool SkGpuDevice::onShouldDisableLCD(const SkPaint& paint) const { |
1780 return GrTextContext::ShouldDisableLCD(paint); | 1781 return GrTextContext::ShouldDisableLCD(paint); |
1781 } | 1782 } |
1782 | 1783 |
1783 void SkGpuDevice::flush() { | 1784 void SkGpuDevice::flush() { |
1784 ASSERT_SINGLE_OWNER | 1785 ASSERT_SINGLE_OWNER |
1785 DO_DEFERRED_CLEAR(); | 1786 DO_DEFERRED_CLEAR(); |
1786 fRenderTarget->prepareForExternalIO(); | 1787 fRenderTarget->prepareForExternalIO(); |
1787 | |
1788 // Clear batch debugging output | |
1789 if (GR_BATCH_DEBUGGING_OUTPUT) { | |
1790 SkDebugf("%s\n", fContext->getAuditTrail()->toJson().c_str()); | |
1791 GR_AUDIT_TRAIL_RESET(fContext->getAuditTrail()); | |
1792 } | |
1793 } | 1788 } |
1794 | 1789 |
1795 /////////////////////////////////////////////////////////////////////////////// | 1790 /////////////////////////////////////////////////////////////////////////////// |
1796 | 1791 |
1797 SkBaseDevice* SkGpuDevice::onCreateDevice(const CreateInfo& cinfo, const SkPaint
*) { | 1792 SkBaseDevice* SkGpuDevice::onCreateDevice(const CreateInfo& cinfo, const SkPaint
*) { |
1798 ASSERT_SINGLE_OWNER | 1793 ASSERT_SINGLE_OWNER |
1799 GrSurfaceDesc desc; | 1794 GrSurfaceDesc desc; |
1800 desc.fConfig = fRenderTarget->config(); | 1795 desc.fConfig = fRenderTarget->config(); |
1801 desc.fFlags = kRenderTarget_GrSurfaceFlag; | 1796 desc.fFlags = kRenderTarget_GrSurfaceFlag; |
1802 desc.fWidth = cinfo.fInfo.width(); | 1797 desc.fWidth = cinfo.fInfo.width(); |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1911 } | 1906 } |
1912 | 1907 |
1913 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { | 1908 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { |
1914 ASSERT_SINGLE_OWNER | 1909 ASSERT_SINGLE_OWNER |
1915 // We always return a transient cache, so it is freed after each | 1910 // We always return a transient cache, so it is freed after each |
1916 // filter traversal. | 1911 // filter traversal. |
1917 return SkGpuDevice::NewImageFilterCache(); | 1912 return SkGpuDevice::NewImageFilterCache(); |
1918 } | 1913 } |
1919 | 1914 |
1920 #endif | 1915 #endif |
OLD | NEW |