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

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

Issue 1782583002: Add support for vertex and geometry shader textures (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: better rebase 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 | « include/gpu/GrTextureAccess.h ('k') | src/gpu/GrTextureAccess.cpp » ('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 #include "GrContext.h" 9 #include "GrContext.h"
10 #include "GrCaps.h" 10 #include "GrCaps.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 if (kDefault_GrSurfaceOrigin == desc.fOrigin) { 81 if (kDefault_GrSurfaceOrigin == desc.fOrigin) {
82 return renderTarget ? kBottomLeft_GrSurfaceOrigin : kTopLeft_GrSurfaceOr igin; 82 return renderTarget ? kBottomLeft_GrSurfaceOrigin : kTopLeft_GrSurfaceOr igin;
83 } else { 83 } else {
84 return desc.fOrigin; 84 return desc.fOrigin;
85 } 85 }
86 } 86 }
87 } 87 }
88 88
89 ////////////////////////////////////////////////////////////////////////////// 89 //////////////////////////////////////////////////////////////////////////////
90 GrTexture::GrTexture(GrGpu* gpu, LifeCycle lifeCycle, const GrSurfaceDesc& desc, 90 GrTexture::GrTexture(GrGpu* gpu, LifeCycle lifeCycle, const GrSurfaceDesc& desc,
91 bool wasMipMapDataProvided) 91 GrSLType samplerType, bool wasMipMapDataProvided)
92 : INHERITED(gpu, lifeCycle, desc) { 92 : INHERITED(gpu, lifeCycle, desc)
93 , fSamplerType(samplerType) {
93 if (!this->isExternal() && !GrPixelConfigIsCompressed(desc.fConfig) && 94 if (!this->isExternal() && !GrPixelConfigIsCompressed(desc.fConfig) &&
94 !desc.fTextureStorageAllocator.fAllocateTextureStorage) { 95 !desc.fTextureStorageAllocator.fAllocateTextureStorage) {
95 GrScratchKey key; 96 GrScratchKey key;
96 GrTexturePriv::ComputeScratchKey(desc, &key); 97 GrTexturePriv::ComputeScratchKey(desc, &key);
97 this->setScratchKey(key); 98 this->setScratchKey(key);
98 } 99 }
99 100
100 if (wasMipMapDataProvided) { 101 if (wasMipMapDataProvided) {
101 fMipMapsStatus = kValid_MipMapsStatus; 102 fMipMapsStatus = kValid_MipMapsStatus;
102 fMaxMipMapLevel = SkMipMap::ComputeLevelCount(fDesc.fWidth, fDesc.fHeigh t); 103 fMaxMipMapLevel = SkMipMap::ComputeLevelCount(fDesc.fWidth, fDesc.fHeigh t);
(...skipping 15 matching lines...) Expand all
118 SkASSERT(desc.fSampleCnt < (1 << 8)); 119 SkASSERT(desc.fSampleCnt < (1 << 8));
119 SkASSERT(flags < (1 << 10)); 120 SkASSERT(flags < (1 << 10));
120 SkASSERT(static_cast<int>(origin) < (1 << 8)); 121 SkASSERT(static_cast<int>(origin) < (1 << 8));
121 122
122 GrScratchKey::Builder builder(key, kType, 3); 123 GrScratchKey::Builder builder(key, kType, 3);
123 builder[0] = desc.fWidth; 124 builder[0] = desc.fWidth;
124 builder[1] = desc.fHeight; 125 builder[1] = desc.fHeight;
125 builder[2] = desc.fConfig | (desc.fIsMipMapped << 5) | (desc.fSampleCnt << 6 ) | (flags << 14) 126 builder[2] = desc.fConfig | (desc.fIsMipMapped << 5) | (desc.fSampleCnt << 6 ) | (flags << 14)
126 | (origin << 24); 127 | (origin << 24);
127 } 128 }
OLDNEW
« no previous file with comments | « include/gpu/GrTextureAccess.h ('k') | src/gpu/GrTextureAccess.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698