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

Side by Side Diff: src/gpu/batches/GrRectBatchFactory.cpp

Issue 1287433003: Create GrRectBatchFactory (Closed) Base URL: https://skia.googlesource.com/skia.git@batchfactory1
Patch Set: Created 5 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
« no previous file with comments | « src/gpu/batches/GrRectBatchFactory.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2015 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #include "GrRectBatchFactory.h"
9
10 #include "GrRectBatch.h"
11
12 namespace GrRectBatchFactory {
13
14 GrBatch* Create(GrColor color,
15 const SkMatrix& viewMatrix,
16 const SkRect& rect,
17 const SkRect* localRect,
18 const SkMatrix* localMatrix) {
19 GrRectBatch::Geometry geometry;
20 geometry.fColor = color;
21 geometry.fViewMatrix = viewMatrix;
22 geometry.fRect = rect;
23
24 if (localRect) {
25 geometry.fHasLocalRect = true;
26 geometry.fLocalRect = *localRect;
27 } else {
28 geometry.fHasLocalRect = false;
29 }
30
31 if (localMatrix) {
32 geometry.fHasLocalMatrix = true;
33 geometry.fLocalMatrix = *localMatrix;
34 } else {
35 geometry.fHasLocalMatrix = false;
36 }
37
38 return GrRectBatch::Create(geometry);
39 }
40
41 };
OLDNEW
« no previous file with comments | « src/gpu/batches/GrRectBatchFactory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698