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

Unified Diff: src/gpu/GrTargetCommands.h

Issue 1315513008: Cleanup GrDrawTarget now that all paths lead to GrBatch (Closed) Base URL: https://skia.googlesource.com/skia.git@patharray
Patch Set: remove change to SampleApp.cpp Created 5 years, 3 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/GrReorderCommandBuilder.cpp ('k') | src/gpu/GrTargetCommands.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrTargetCommands.h
diff --git a/src/gpu/GrTargetCommands.h b/src/gpu/GrTargetCommands.h
deleted file mode 100644
index 5d9cdfc5be8ce30d3c9ec94651ab7f298f2728cf..0000000000000000000000000000000000000000
--- a/src/gpu/GrTargetCommands.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright 2015 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#ifndef GrTargetCommands_DEFINED
-#define GrTargetCommands_DEFINED
-
-#include "GrDrawTarget.h"
-#include "GrPath.h"
-#include "GrPendingProgramElement.h"
-#include "GrPrimitiveProcessor.h"
-#include "GrRenderTarget.h"
-#include "GrTRecorder.h"
-
-#include "batches/GrBatch.h"
-
-#include "SkRect.h"
-
-class GrResourceProvider;
-class GrBatchFlushState;
-
-// TODO: Convert all commands into GrBatch and remove this class.
-class GrTargetCommands : ::SkNoncopyable {
-public:
- GrTargetCommands() : fCmdBuffer(kCmdBufferInitialSizeInBytes), fLastFlushToken(0) {}
-
- class Cmd : ::SkNoncopyable {
- public:
- enum CmdType {
- kDrawBatch_CmdType = 4,
- };
-
- Cmd(CmdType type)
- : fType(type)
-#if GR_BATCH_SPEW
- , fUniqueID(GenID(&gUniqueID))
-#endif
- {}
- virtual ~Cmd() {}
-
- virtual void execute(GrBatchFlushState*) = 0;
-
- CmdType type() const { return fType; }
-
- GrBATCH_SPEW(uint32_t uniqueID() const { return fUniqueID;} )
-
- private:
- // TODO move this to a common header so it can be shared with GrBatch
- static uint32_t GenID(int32_t* idCounter) {
- uint32_t id = static_cast<uint32_t>(sk_atomic_inc(idCounter)) + 1;
- if (!id) {
- SkFAIL("This should never wrap\n");
- }
- return id;
- }
- CmdType fType;
- GrBATCH_SPEW(uint32_t fUniqueID);
- GrBATCH_SPEW(static int32_t gUniqueID;)
- };
-
- void reset();
- void flush(GrGpu*, GrResourceProvider*);
-
-private:
- friend class GrCommandBuilder;
- friend class GrBufferedDrawTarget; // This goes away when State becomes just a pipeline
- friend class GrReorderCommandBuilder;
-
- typedef GrGpu::DrawArgs DrawArgs;
-
- struct DrawBatch : public Cmd {
- DrawBatch(GrBatch* batch)
- : Cmd(kDrawBatch_CmdType)
- , fBatch(SkRef(batch)){
- SkASSERT(!batch->isUsed());
- }
-
- GrBatch* batch() { return fBatch; }
- void execute(GrBatchFlushState*) override;
-
- private:
- SkAutoTUnref<GrBatch> fBatch;
- };
-
- static const int kCmdBufferInitialSizeInBytes = 8 * 1024;
-
- typedef void* TCmdAlign; // This wouldn't be enough align if a command used long double.
- typedef GrTRecorder<Cmd, TCmdAlign> CmdBuffer;
-
- CmdBuffer* cmdBuffer() { return &fCmdBuffer; }
-
- CmdBuffer fCmdBuffer;
- GrBatchToken fLastFlushToken;
-};
-
-#endif
« no previous file with comments | « src/gpu/GrReorderCommandBuilder.cpp ('k') | src/gpu/GrTargetCommands.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698