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

Unified Diff: src/gpu/GrGpu.cpp

Issue 1831133004: Revert of Consolidate GPU buffer implementations (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrGpu.h ('k') | src/gpu/GrIndexBuffer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrGpu.cpp
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp
index 35c04caa239cce0659e2c9b99b0d36b294bae2ee..177fbabc5936764a076cb9bb1943549773655e2e 100644
--- a/src/gpu/GrGpu.cpp
+++ b/src/gpu/GrGpu.cpp
@@ -8,10 +8,10 @@
#include "GrGpu.h"
-#include "GrBuffer.h"
#include "GrCaps.h"
#include "GrContext.h"
#include "GrGpuResourcePriv.h"
+#include "GrIndexBuffer.h"
#include "GrMesh.h"
#include "GrPathRendering.h"
#include "GrPipeline.h"
@@ -20,6 +20,8 @@
#include "GrRenderTargetPriv.h"
#include "GrStencilAttachment.h"
#include "GrSurfacePriv.h"
+#include "GrTransferBuffer.h"
+#include "GrVertexBuffer.h"
#include "SkTypes.h"
GrMesh& GrMesh::operator =(const GrMesh& di) {
@@ -236,13 +238,28 @@
return this->onWrapBackendTextureAsRenderTarget(desc, ownership);
}
-GrBuffer* GrGpu::createBuffer(GrBufferType type, size_t size, GrAccessPattern accessPattern) {
- this->handleDirtyContext();
- GrBuffer* buffer = this->onCreateBuffer(type, size, accessPattern);
+GrVertexBuffer* GrGpu::createVertexBuffer(size_t size, bool dynamic) {
+ this->handleDirtyContext();
+ GrVertexBuffer* vb = this->onCreateVertexBuffer(size, dynamic);
if (!this->caps()->reuseScratchBuffers()) {
- buffer->resourcePriv().removeScratchKey();
- }
- return buffer;
+ vb->resourcePriv().removeScratchKey();
+ }
+ return vb;
+}
+
+GrIndexBuffer* GrGpu::createIndexBuffer(size_t size, bool dynamic) {
+ this->handleDirtyContext();
+ GrIndexBuffer* ib = this->onCreateIndexBuffer(size, dynamic);
+ if (!this->caps()->reuseScratchBuffers()) {
+ ib->resourcePriv().removeScratchKey();
+ }
+ return ib;
+}
+
+GrTransferBuffer* GrGpu::createTransferBuffer(size_t size, TransferType type) {
+ this->handleDirtyContext();
+ GrTransferBuffer* tb = this->onCreateTransferBuffer(size, type);
+ return tb;
}
void GrGpu::clear(const SkIRect& rect,
@@ -399,13 +416,13 @@
bool GrGpu::transferPixels(GrSurface* surface,
int left, int top, int width, int height,
- GrPixelConfig config, GrBuffer* transferBuffer,
+ GrPixelConfig config, GrTransferBuffer* buffer,
size_t offset, size_t rowBytes) {
- SkASSERT(transferBuffer);
+ SkASSERT(buffer);
this->handleDirtyContext();
if (this->onTransferPixels(surface, left, top, width, height, config,
- transferBuffer, offset, rowBytes)) {
+ buffer, offset, rowBytes)) {
fStats.incTransfersToTexture();
return true;
}
« no previous file with comments | « src/gpu/GrGpu.h ('k') | src/gpu/GrIndexBuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698