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

Side by Side Diff: src/gpu/GrBufferedDrawTarget.cpp

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 unified diff | Download patch
« no previous file with comments | « src/gpu/GrBufferedDrawTarget.h ('k') | src/gpu/GrContext.cpp » ('j') | 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 2011 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 "GrBufferedDrawTarget.h"
9
10 // We will use the reordering buffer, unless we have NVPR.
11 // TODO move NVPR to batch so we can reorder
12 static inline bool allow_reordering(const GrCaps* caps) {
13 return caps && caps->shaderCaps() && !caps->shaderCaps()->pathRenderingSuppo rt();
14 }
15
16 GrBufferedDrawTarget::GrBufferedDrawTarget(GrContext* context)
17 : INHERITED(context)
18 , fCommands(GrCommandBuilder::Create(context->getGpu(), allow_reordering(con text->caps())))
19 , fDrawID(0) {
20 }
21
22 GrBufferedDrawTarget::~GrBufferedDrawTarget() {
23 this->reset();
24 }
25
26 void GrBufferedDrawTarget::onDrawBatch(GrBatch* batch) {
27 fCommands->recordDrawBatch(batch, *this->caps());
28 }
29
30 void GrBufferedDrawTarget::onFlush() {
31 fCommands->flush(this->getGpu(), this->getContext()->resourceProvider());
32 ++fDrawID;
33 }
34
35 void GrBufferedDrawTarget::onReset() {
36 fCommands->reset();
37 }
OLDNEW
« no previous file with comments | « src/gpu/GrBufferedDrawTarget.h ('k') | src/gpu/GrContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698