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

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

Issue 846303002: Make uncached textures uncached from the get go. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add comment Created 5 years, 11 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/GrDistanceFieldTextContext.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
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 * 92 *
93 * @return returns true if the update succeeds, false otherwise. 93 * @return returns true if the update succeeds, false otherwise.
94 */ 94 */
95 bool updateData(const void* src, size_t srcSizeInBytes) { 95 bool updateData(const void* src, size_t srcSizeInBytes) {
96 SkASSERT(!this->isMapped()); 96 SkASSERT(!this->isMapped());
97 SkASSERT(srcSizeInBytes <= fGpuMemorySize); 97 SkASSERT(srcSizeInBytes <= fGpuMemorySize);
98 return this->onUpdateData(src, srcSizeInBytes); 98 return this->onUpdateData(src, srcSizeInBytes);
99 } 99 }
100 100
101 protected: 101 protected:
102 GrGeometryBuffer(GrGpu* gpu, bool isWrapped, size_t gpuMemorySize, bool dyna mic, bool cpuBacked) 102 GrGeometryBuffer(GrGpu* gpu, size_t gpuMemorySize, bool dynamic, bool cpuBac ked)
103 : INHERITED(gpu, isWrapped) 103 : INHERITED(gpu, kCached_LifeCycle)
104 , fMapPtr(NULL) 104 , fMapPtr(NULL)
105 , fGpuMemorySize(gpuMemorySize) 105 , fGpuMemorySize(gpuMemorySize)
106 , fDynamic(dynamic) 106 , fDynamic(dynamic)
107 , fCPUBacked(cpuBacked) {} 107 , fCPUBacked(cpuBacked) {}
108 108
109 private: 109 private:
110 virtual size_t onGpuMemorySize() const { return fGpuMemorySize; } 110 virtual size_t onGpuMemorySize() const { return fGpuMemorySize; }
111 111
112 virtual void* onMap() = 0; 112 virtual void* onMap() = 0;
113 virtual void onUnmap() = 0; 113 virtual void onUnmap() = 0;
114 virtual bool onUpdateData(const void* src, size_t srcSizeInBytes) = 0; 114 virtual bool onUpdateData(const void* src, size_t srcSizeInBytes) = 0;
115 115
116 void* fMapPtr; 116 void* fMapPtr;
117 size_t fGpuMemorySize; 117 size_t fGpuMemorySize;
118 bool fDynamic; 118 bool fDynamic;
119 bool fCPUBacked; 119 bool fCPUBacked;
120 120
121 typedef GrGpuResource INHERITED; 121 typedef GrGpuResource INHERITED;
122 }; 122 };
123 123
124 #endif 124 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrDistanceFieldTextContext.cpp ('k') | src/gpu/GrGpu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698