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

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

Issue 1117433002: Remove GrFlushToGpuDrawTarget and move functionality up to GrDrawTarget. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: more Created 5 years, 7 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/GrFlushToGpuDrawTarget.h ('k') | src/gpu/GrInOrderDrawBuffer.h » ('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 2014 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 "GrFlushToGpuDrawTarget.h"
9 #include "GrContext.h"
10 #include "GrGpu.h"
11 #include "GrBufferAllocPool.h"
12
13 GrFlushToGpuDrawTarget::GrFlushToGpuDrawTarget(GrGpu* gpu,
14 GrVertexBufferAllocPool* vertexPo ol,
15 GrIndexBufferAllocPool* indexPool )
16 : INHERITED(gpu->getContext())
17 , fGpu(SkRef(gpu))
18 , fVertexPool(vertexPool)
19 , fIndexPool(indexPool)
20 , fFlushing(false) {
21
22 fCaps.reset(SkRef(fGpu->caps()));
23
24 SkASSERT(vertexPool);
25 SkASSERT(indexPool);
26
27 }
28
29 void GrFlushToGpuDrawTarget::reset() {
30 fVertexPool->reset();
31 fIndexPool->reset();
32
33 this->onReset();
34 }
35
36 void GrFlushToGpuDrawTarget::flush() {
37 if (fFlushing) {
38 return;
39 }
40 fFlushing = true;
41
42 fGpu->saveActiveTraceMarkers();
43
44 this->onFlush();
45
46 fGpu->restoreActiveTraceMarkers();
47
48 fFlushing = false;
49 this->reset();
50 }
51
52 bool GrFlushToGpuDrawTarget::onCanCopySurface(const GrSurface* dst,
53 const GrSurface* src,
54 const SkIRect& srcRect,
55 const SkIPoint& dstPoint) {
56 return getGpu()->canCopySurface(dst, src, srcRect, dstPoint);
57 }
58
59 bool GrFlushToGpuDrawTarget::onInitCopySurfaceDstDesc(const GrSurface* src, GrSu rfaceDesc* desc) {
60 return getGpu()->initCopySurfaceDstDesc(src, desc);
61 }
OLDNEW
« no previous file with comments | « src/gpu/GrFlushToGpuDrawTarget.h ('k') | src/gpu/GrInOrderDrawBuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698