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

Side by Side Diff: src/gpu/GrGeometryBuffer.h

Issue 251013002: Split GrResource into GrCacheable/GrGpuObject (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase Created 6 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 | Annotate | Revision Log
« no previous file with comments | « src/gpu/GrDrawTarget.cpp ('k') | src/gpu/GrGpu.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #ifndef GrGeometryBuffer_DEFINED 10 #ifndef GrGeometryBuffer_DEFINED
11 #define GrGeometryBuffer_DEFINED 11 #define GrGeometryBuffer_DEFINED
12 12
13 #include "GrResource.h" 13 #include "GrGpuObject.h"
14 14
15 class GrGpu; 15 class GrGpu;
16 16
17 /** 17 /**
18 * Parent class for vertex and index buffers 18 * Parent class for vertex and index buffers
19 */ 19 */
20 class GrGeometryBuffer : public GrResource { 20 class GrGeometryBuffer : public GrGpuObject {
21 public: 21 public:
22 SK_DECLARE_INST_COUNT(GrGeometryBuffer); 22 SK_DECLARE_INST_COUNT(GrGeometryBuffer);
23 23
24 /** 24 /**
25 *Retrieves whether the buffer was created with the dynamic flag 25 *Retrieves whether the buffer was created with the dynamic flag
26 * 26 *
27 * @return true if the buffer was created with the dynamic flag 27 * @return true if the buffer was created with the dynamic flag
28 */ 28 */
29 bool dynamic() const { return fDynamic; } 29 bool dynamic() const { return fDynamic; }
30 30
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 * Updates the buffer data. 75 * Updates the buffer data.
76 * 76 *
77 * The size of the buffer will be preserved. The src data will be 77 * The size of the buffer will be preserved. The src data will be
78 * placed at the beginning of the buffer and any remaining contents will 78 * placed at the beginning of the buffer and any remaining contents will
79 * be undefined. 79 * be undefined.
80 * 80 *
81 * @return returns true if the update succeeds, false otherwise. 81 * @return returns true if the update succeeds, false otherwise.
82 */ 82 */
83 virtual bool updateData(const void* src, size_t srcSizeInBytes) = 0; 83 virtual bool updateData(const void* src, size_t srcSizeInBytes) = 0;
84 84
85 // GrResource overrides 85 // GrGpuObject overrides
86 virtual size_t sizeInBytes() const { return fSizeInBytes; } 86 virtual size_t gpuMemorySize() const { return fGpuMemorySize; }
87 87
88 protected: 88 protected:
89 GrGeometryBuffer(GrGpu* gpu, bool isWrapped, size_t sizeInBytes, bool dynami c, bool cpuBacked) 89 GrGeometryBuffer(GrGpu* gpu, bool isWrapped, size_t gpuMemorySize, bool dyna mic, bool cpuBacked)
90 : INHERITED(gpu, isWrapped) 90 : INHERITED(gpu, isWrapped)
91 , fSizeInBytes(sizeInBytes) 91 , fGpuMemorySize(gpuMemorySize)
92 , fDynamic(dynamic) 92 , fDynamic(dynamic)
93 , fCPUBacked(cpuBacked) {} 93 , fCPUBacked(cpuBacked) {}
94 94
95 private: 95 private:
96 size_t fSizeInBytes; 96 size_t fGpuMemorySize;
97 bool fDynamic; 97 bool fDynamic;
98 bool fCPUBacked; 98 bool fCPUBacked;
99 99
100 typedef GrResource INHERITED; 100 typedef GrGpuObject INHERITED;
101 }; 101 };
102 102
103 #endif 103 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrDrawTarget.cpp ('k') | src/gpu/GrGpu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698