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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/batches/GrRectBatchFactory.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/batches/GrRectBatchFactory.cpp
diff --git a/src/gpu/batches/GrRectBatchFactory.cpp b/src/gpu/batches/GrRectBatchFactory.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..b41561209e1c19239d4f35a37aa7df34dc6bba82
--- /dev/null
+++ b/src/gpu/batches/GrRectBatchFactory.cpp
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "GrRectBatchFactory.h"
+
+#include "GrRectBatch.h"
+
+namespace GrRectBatchFactory {
+
+GrBatch* Create(GrColor color,
+ const SkMatrix& viewMatrix,
+ const SkRect& rect,
+ const SkRect* localRect,
+ const SkMatrix* localMatrix) {
+ GrRectBatch::Geometry geometry;
+ geometry.fColor = color;
+ geometry.fViewMatrix = viewMatrix;
+ geometry.fRect = rect;
+
+ if (localRect) {
+ geometry.fHasLocalRect = true;
+ geometry.fLocalRect = *localRect;
+ } else {
+ geometry.fHasLocalRect = false;
+ }
+
+ if (localMatrix) {
+ geometry.fHasLocalMatrix = true;
+ geometry.fLocalMatrix = *localMatrix;
+ } else {
+ geometry.fHasLocalMatrix = false;
+ }
+
+ return GrRectBatch::Create(geometry);
+}
+
+};
« 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