Lines Matching +full:- +full:nv

4  * Use of this source code is governed by a BSD-style license that can be
35 size->set(bm.width(), bm.height()); in make_shader0()
80 static void eval_sheet(const SkPoint edge[], int nu, int nv, int iu, int iv, in eval_sheet() argument
84 const int BR = TR + nv; in eval_sheet()
88 SkScalar v = SkIntToScalar(iv) / nv; in eval_sheet()
91 SkScalar Uv = (1 - u) * v; in eval_sheet()
92 SkScalar uV = u * (1 - v); in eval_sheet()
93 SkScalar UV = (1 - u) * (1 - v); in eval_sheet()
98 SkScalar x = (1 - v) * edge[TL+iu].fX + u * edge[TR+iv].fX + in eval_sheet()
99 v * edge[BR+nu-iu].fX + (1 - u) * edge[BL+nv-iv].fX - x0; in eval_sheet()
100 SkScalar y = (1 - v) * edge[TL+iu].fY + u * edge[TR+iv].fY + in eval_sheet()
101 v * edge[BR+nu-iu].fY + (1 - u) * edge[BL+nv-iv].fY - y0; in eval_sheet()
102 pt->set(x, y); in eval_sheet()
109 void Patch::draw(SkCanvas* canvas, const SkPaint& paint, int nu, int nv, in draw() argument
111 if (nu < 1 || nv < 1) { in draw()
115 int i, npts = (nu + nv) * 2; in draw()
119 SkPoint* edge2 = edge1 + nv; in draw()
124 eval_patch_edge(fPts + 3, edge1, nv); in draw()
126 eval_patch_edge(fPts + 9, edge3, nv); in draw()
127 edge3[nv] = edge0[0]; // the last shall be first in draw()
130 // canvas->drawLine(edge0[i].fX, edge0[i].fY, edge0[i+1].fX, edge0[i+1].fY, paint); in draw()
133 int row, vertCount = (nu + 1) * (nv + 1); in draw()
141 for (row = 1; row < nv; row++) { in draw()
143 r[0] = edge3[nv - row]; in draw()
145 eval_sheet(edge0, nu, nv, col, row, &r[col]); in draw()
150 SkPoint* last = verts + nv * (nu + 1); in draw()
152 last[i] = edge2[nu - i]; in draw()
155 // canvas->drawPoints(verts, vertCount, paint); in draw()
165 const SkScalar dt = SK_Scalar1 * fH / nv; in draw()
167 for (row = 0; row < nv; row++) { in draw()
182 canvas->drawVertices(SkVertices::MakeCopy(SkVertices::kTriangleStrip_VertexMode, stripCount, in draw()
189 static void drawpatches(SkCanvas* canvas, const SkPaint& paint, int nu, int nv, in drawpatches() argument
193 patch->draw(canvas, paint, nu, nv, false, false); in drawpatches()
194 canvas->translate(SkIntToScalar(180), 0); in drawpatches()
195 patch->draw(canvas, paint, nu, nv, true, false); in drawpatches()
196 canvas->translate(SkIntToScalar(180), 0); in drawpatches()
197 patch->draw(canvas, paint, nu, nv, false, true); in drawpatches()
198 canvas->translate(SkIntToScalar(180), 0); in drawpatches()
199 patch->draw(canvas, paint, nu, nv, true, true); in drawpatches()
236 this->setBGColor(SK_ColorGRAY); in PatchView()
245 return this->INHERITED::onQuery(evt); in onQuery()
250 const int nv = 10; in onDrawContent() local
256 canvas->translate(DX, DY); in onDrawContent()
270 drawpatches(canvas, paint, nu, nv, &patch); in onDrawContent()
275 canvas->drawPoints(SkCanvas::kPoints_PointMode, SK_ARRAY_COUNT(fPts), fPts, paint); in onDrawContent()
277 canvas->translate(0, SkIntToScalar(300)); in onDrawContent()
284 paint.setShader(paint.getShader()->makeWithLocalMatrix(m)); in onDrawContent()
289 paint.setShader(paint.getShader()->makeWithLocalMatrix(m)); in onDrawContent()
292 drawpatches(canvas, paint, nu, nv, &patch); in onDrawContent()
307 return SkPoint::Length(pt.fX - x, pt.fY - y) < SkIntToScalar(5); in hittest()
311 x -= DX; in onFindClickHandler()
312 y -= DY; in onFindClickHandler()
318 return this->INHERITED::onFindClickHandler(x, y, modi); in onFindClickHandler()
322 fPts[((PtClick*)click)->fIndex].set(click->fCurr.fX - DX, click->fCurr.fY - DY); in onClick()