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

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

Issue 26695005: separate state for msaa renderability (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: bool to int Created 7 years, 2 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/GrDrawTargetCaps.h ('k') | src/gpu/SkGpuDevice.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 2010 Google Inc. 3 * Copyright 2010 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 #include "GrGpu.h" 10 #include "GrGpu.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 #endif 106 #endif
107 } 107 }
108 108
109 //////////////////////////////////////////////////////////////////////////////// 109 ////////////////////////////////////////////////////////////////////////////////
110 110
111 GrTexture* GrGpu::createTexture(const GrTextureDesc& desc, 111 GrTexture* GrGpu::createTexture(const GrTextureDesc& desc,
112 const void* srcData, size_t rowBytes) { 112 const void* srcData, size_t rowBytes) {
113 if (kUnknown_GrPixelConfig == desc.fConfig) { 113 if (kUnknown_GrPixelConfig == desc.fConfig) {
114 return NULL; 114 return NULL;
115 } 115 }
116 if ((desc.fFlags & kRenderTarget_GrTextureFlagBit) &&
117 !this->caps()->isConfigRenderable(desc.fConfig, desc.fSampleCnt > 0)) {
118 return NULL;
119 }
116 120
117 this->handleDirtyContext(); 121 this->handleDirtyContext();
118 GrTexture* tex = this->onCreateTexture(desc, srcData, rowBytes); 122 GrTexture* tex = this->onCreateTexture(desc, srcData, rowBytes);
119 if (NULL != tex && 123 if (NULL != tex &&
120 (kRenderTarget_GrTextureFlagBit & desc.fFlags) && 124 (kRenderTarget_GrTextureFlagBit & desc.fFlags) &&
121 !(kNoStencil_GrTextureFlagBit & desc.fFlags)) { 125 !(kNoStencil_GrTextureFlagBit & desc.fFlags)) {
122 SkASSERT(NULL != tex->asRenderTarget()); 126 SkASSERT(NULL != tex->asRenderTarget());
123 // TODO: defer this and attach dynamically 127 // TODO: defer this and attach dynamically
124 if (!this->attachStencilBufferToRenderTarget(tex->asRenderTarget())) { 128 if (!this->attachStencilBufferToRenderTarget(tex->asRenderTarget())) {
125 tex->unref(); 129 tex->unref();
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 } 538 }
535 539
536 void GrGpu::releaseIndexArray() { 540 void GrGpu::releaseIndexArray() {
537 // if index source was array, we stowed data in the pool 541 // if index source was array, we stowed data in the pool
538 const GeometrySrcState& geoSrc = this->getGeomSrc(); 542 const GeometrySrcState& geoSrc = this->getGeomSrc();
539 SkASSERT(kArray_GeometrySrcType == geoSrc.fIndexSrc); 543 SkASSERT(kArray_GeometrySrcType == geoSrc.fIndexSrc);
540 size_t bytes = geoSrc.fIndexCount * sizeof(uint16_t); 544 size_t bytes = geoSrc.fIndexCount * sizeof(uint16_t);
541 fIndexPool->putBack(bytes); 545 fIndexPool->putBack(bytes);
542 --fIndexPoolUseCnt; 546 --fIndexPoolUseCnt;
543 } 547 }
OLDNEW
« no previous file with comments | « src/gpu/GrDrawTargetCaps.h ('k') | src/gpu/SkGpuDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698