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 "effects/GrBicubicEffect.h" | 10 #include "effects/GrBicubicEffect.h" |
(...skipping 1689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1700 fContext->drawVertices(grPaint, | 1700 fContext->drawVertices(grPaint, |
1701 primType, | 1701 primType, |
1702 vertexCount, | 1702 vertexCount, |
1703 vertices, | 1703 vertices, |
1704 texs, | 1704 texs, |
1705 colors, | 1705 colors, |
1706 outIndices, | 1706 outIndices, |
1707 indexCount); | 1707 indexCount); |
1708 } | 1708 } |
1709 | 1709 |
| 1710 void SkGpuDevice::drawPatch(const SkDraw& draw, const SkPatch& patch, const SkPa
int& paint) { |
| 1711 SkPatch::VertexData data; |
| 1712 patch.getVertexData(&data, draw.fMatrix->getScaleX() * 10, draw.fMatrix->get
ScaleY() * 10); |
| 1713 this->drawVertices(draw, SkCanvas::kTriangles_VertexMode, data.fVertexCount,
data.fPoints, |
| 1714 data.fTexCoords, data.fColors, NULL, data.fIndices, data.
fIndexCount, paint); |
| 1715 } |
| 1716 |
1710 /////////////////////////////////////////////////////////////////////////////// | 1717 /////////////////////////////////////////////////////////////////////////////// |
1711 | 1718 |
1712 void SkGpuDevice::drawText(const SkDraw& draw, const void* text, | 1719 void SkGpuDevice::drawText(const SkDraw& draw, const void* text, |
1713 size_t byteLength, SkScalar x, SkScalar y, | 1720 size_t byteLength, SkScalar x, SkScalar y, |
1714 const SkPaint& paint) { | 1721 const SkPaint& paint) { |
1715 CHECK_SHOULD_DRAW(draw, false); | 1722 CHECK_SHOULD_DRAW(draw, false); |
1716 GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice::drawText", fContext); | 1723 GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice::drawText", fContext); |
1717 | 1724 |
1718 if (fMainTextContext->canDraw(paint)) { | 1725 if (fMainTextContext->canDraw(paint)) { |
1719 GrPaint grPaint; | 1726 GrPaint grPaint; |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2051 playback.draw(canvas, NULL); | 2058 playback.draw(canvas, NULL); |
2052 | 2059 |
2053 // unlock the layers | 2060 // unlock the layers |
2054 for (int i = 0; i < gpuData->numSaveLayers(); ++i) { | 2061 for (int i = 0; i < gpuData->numSaveLayers(); ++i) { |
2055 GrCachedLayer* layer = fContext->getLayerCache()->findLayer(picture, i); | 2062 GrCachedLayer* layer = fContext->getLayerCache()->findLayer(picture, i); |
2056 fContext->getLayerCache()->unlock(layer); | 2063 fContext->getLayerCache()->unlock(layer); |
2057 } | 2064 } |
2058 | 2065 |
2059 return true; | 2066 return true; |
2060 } | 2067 } |
OLD | NEW |