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

Side by Side Diff: src/gpu/SkGpuDevice.cpp

Issue 424663006: SkCanvas interface for drawing a patch. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 4 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 unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW
« src/core/SkCanvas.cpp ('K') | « src/gpu/GrPictureUtils.cpp ('k') | src/pdf/SkPDFDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698