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

Unified Diff: src/gpu/GrBatchTarget.cpp

Issue 975303005: Creation of GrBatchAtlas and Distancefieldpathrenderer batch (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: nit Created 5 years, 9 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/GrBatchTarget.h ('k') | src/gpu/GrBitmapTextContext.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrBatchTarget.cpp
diff --git a/src/gpu/GrBatchTarget.cpp b/src/gpu/GrBatchTarget.cpp
index 21658d2a01a19eb31ad7343c32649a29c86a8228..4c24a80c95f1c47cf34262eedf6697da68d3f374 100644
--- a/src/gpu/GrBatchTarget.cpp
+++ b/src/gpu/GrBatchTarget.cpp
@@ -7,42 +7,49 @@
#include "GrBatchTarget.h"
+#include "GrBatchAtlas.h"
#include "GrPipeline.h"
-/*
-void GrBatchTarget::flush() {
- FlushBuffer::Iter iter(fFlushBuffer);
- fVertexPool->unmap();
- fIndexPool->unmap();
+GrBatchTarget::GrBatchTarget(GrGpu* gpu,
+ GrVertexBufferAllocPool* vpool,
+ GrIndexBufferAllocPool* ipool)
+ : fGpu(gpu)
+ , fVertexPool(vpool)
+ , fIndexPool(ipool)
+ , fFlushBuffer(kFlushBufferInitialSizeInBytes)
+ , fIter(fFlushBuffer)
+ , fNumberOfDraws(0)
+ , fCurrentToken(0)
+ , fLastFlushedToken(0)
+ , fInlineUpdatesIndex(0) {
+}
- while (iter.next()) {
- GrProgramDesc desc;
- BufferedFlush* bf = iter.get();
- const GrPipeline* pipeline = bf->fPipeline;
- const GrPrimitiveProcessor* primProc = bf->fPrimitiveProcessor.get();
- fGpu->buildProgramDesc(&desc, *primProc, *pipeline, bf->fBatchTracker);
-
- GrGpu::DrawArgs args(primProc, pipeline, &desc, &bf->fBatchTracker);
- for (int i = 0; i < bf->fDraws.count(); i++) {
- fGpu->draw(args, bf->fDraws[i]);
- }
- }
- fFlushBuffer.reset();
-}*/
-/*
-void GrBatchTarget::flushNext(int n) {
+void GrBatchTarget::flushNext(int n) {
for (; n > 0; n--) {
+ fLastFlushedToken++;
SkDEBUGCODE(bool verify =) fIter.next();
SkASSERT(verify);
- GrProgramDesc desc;
+
BufferedFlush* bf = fIter.get();
+
+ // Flush all texture uploads
+ int uploadCount = fInlineUploads.count();
+ while (fInlineUpdatesIndex < uploadCount &&
+ fInlineUploads[fInlineUpdatesIndex]->lastUploadToken() <= fLastFlushedToken) {
+ fInlineUploads[fInlineUpdatesIndex++]->upload(TextureUploader(fGpu));
+ }
+
+ GrProgramDesc desc;
const GrPipeline* pipeline = bf->fPipeline;
const GrPrimitiveProcessor* primProc = bf->fPrimitiveProcessor.get();
fGpu->buildProgramDesc(&desc, *primProc, *pipeline, bf->fBatchTracker);
GrGpu::DrawArgs args(primProc, pipeline, &desc, &bf->fBatchTracker);
- for (int i = 0; i < bf->fDraws.count(); i++) {
- fGpu->draw(args, bf->fDraws[i]);
+
+ int drawCount = bf->fDraws.count();
+ const SkSTArray<1, DrawInfo, true>& draws = bf->fDraws;
+ for (int i = 0; i < drawCount; i++) {
+ fGpu->draw(args, draws[i]);
}
}
-}*/
+}
« no previous file with comments | « src/gpu/GrBatchTarget.h ('k') | src/gpu/GrBitmapTextContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698