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

Unified Diff: src/record/SkRecordDraw.h

Issue 331573004: Add EXPERIMENTAL_beginRecording() for SkRecord-based recording. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: put back Created 6 years, 6 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/record/SkRecord.h ('k') | src/record/SkRecordDraw.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/record/SkRecordDraw.h
diff --git a/src/record/SkRecordDraw.h b/src/record/SkRecordDraw.h
deleted file mode 100644
index 359679a6d7445f3852db152c591f57f8ce27ad21..0000000000000000000000000000000000000000
--- a/src/record/SkRecordDraw.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright 2014 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#ifndef SkRecordDraw_DEFINED
-#define SkRecordDraw_DEFINED
-
-#include "SkRecord.h"
-#include "SkCanvas.h"
-
-// Draw an SkRecord into an SkCanvas. A convenience wrapper around SkRecords::Draw.
-void SkRecordDraw(const SkRecord&, SkCanvas*);
-
-namespace SkRecords {
-
-// This is an SkRecord visitor that will draw that SkRecord to an SkCanvas.
-class Draw : SkNoncopyable {
-public:
- explicit Draw(SkCanvas* canvas)
- : fInitialCTM(canvas->getTotalMatrix()), fCanvas(canvas), fIndex(0) {}
-
- unsigned index() const { return fIndex; }
- void next() { ++fIndex; }
-
- template <typename T> void operator()(const T& r) {
- if (!this->skip(r)) {
- this->draw(r);
- }
- }
-
-private:
- // No base case, so we'll be compile-time checked that we implement all possibilities.
- template <typename T> void draw(const T&);
-
- // skip() should return true if we can skip this command, false if not.
- // It may update fIndex directly to skip more than just this one command.
-
- // Mostly we just blindly call fCanvas and let it handle quick rejects itself.
- template <typename T> bool skip(const T&) { return false; }
-
- // We add our own quick rejects for commands added by optimizations.
- bool skip(const PairedPushCull&);
- bool skip(const BoundedDrawPosTextH&);
-
- const SkMatrix fInitialCTM;
- SkCanvas* fCanvas;
- unsigned fIndex;
-};
-
-} // namespace SkRecords
-
-#endif//SkRecordDraw_DEFINED
« no previous file with comments | « src/record/SkRecord.h ('k') | src/record/SkRecordDraw.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698