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

Side by Side Diff: src/gpu/gl/GrGLTransferBuffer.cpp

Issue 1825393002: Consolidate GPU buffer implementations (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: asserts Created 4 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 unified diff | Download patch
« no previous file with comments | « src/gpu/gl/GrGLTransferBuffer.h ('k') | src/gpu/gl/GrGLVertexArray.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 2015 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 "GrGLTransferBuffer.h"
9 #include "GrGLGpu.h"
10 #include "SkTraceMemoryDump.h"
11
12 GrGLTransferBuffer::GrGLTransferBuffer(GrGLGpu* gpu, const Desc& desc, GrGLenum type)
13 : INHERITED(gpu, desc.fSizeInBytes)
14 , fImpl(gpu, desc, type) {
15 this->registerWithCache();
16 }
17
18 void GrGLTransferBuffer::onRelease() {
19 if (!this->wasDestroyed()) {
20 fImpl.release(this->getGpuGL());
21 }
22
23 INHERITED::onRelease();
24 }
25
26 void GrGLTransferBuffer::onAbandon() {
27 fImpl.abandon();
28 INHERITED::onAbandon();
29 }
30
31 void* GrGLTransferBuffer::onMap() {
32 if (!this->wasDestroyed()) {
33 return fImpl.map(this->getGpuGL());
34 } else {
35 return nullptr;
36 }
37 }
38
39 void GrGLTransferBuffer::onUnmap() {
40 if (!this->wasDestroyed()) {
41 fImpl.unmap(this->getGpuGL());
42 }
43 }
44
45 void GrGLTransferBuffer::setMemoryBacking(SkTraceMemoryDump* traceMemoryDump,
46 const SkString& dumpName) const {
47 SkString buffer_id;
48 buffer_id.appendU32(this->bufferID());
49 traceMemoryDump->setMemoryBacking(dumpName.c_str(), "gl_buffer",
50 buffer_id.c_str());
51 }
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLTransferBuffer.h ('k') | src/gpu/gl/GrGLVertexArray.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698