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

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

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/GrGpu.h ('k') | src/gpu/GrGpuResource.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 16 matching lines...) Expand all
27 } 27 }
28 28
29 GrGpu::~GrGpu() { 29 GrGpu::~GrGpu() {
30 SkSafeSetNull(fQuadIndexBuffer); 30 SkSafeSetNull(fQuadIndexBuffer);
31 } 31 }
32 32
33 void GrGpu::contextAbandoned() {} 33 void GrGpu::contextAbandoned() {}
34 34
35 //////////////////////////////////////////////////////////////////////////////// 35 ////////////////////////////////////////////////////////////////////////////////
36 36
37 GrTexture* GrGpu::createTexture(const GrSurfaceDesc& desc, 37 GrTexture* GrGpu::createTexture(const GrSurfaceDesc& desc, bool budgeted,
38 const void* srcData, size_t rowBytes) { 38 const void* srcData, size_t rowBytes) {
39 if (!this->caps()->isConfigTexturable(desc.fConfig)) { 39 if (!this->caps()->isConfigTexturable(desc.fConfig)) {
40 return NULL; 40 return NULL;
41 } 41 }
42 42
43 if ((desc.fFlags & kRenderTarget_GrSurfaceFlag) && 43 if ((desc.fFlags & kRenderTarget_GrSurfaceFlag) &&
44 !this->caps()->isConfigRenderable(desc.fConfig, desc.fSampleCnt > 0)) { 44 !this->caps()->isConfigRenderable(desc.fConfig, desc.fSampleCnt > 0)) {
45 return NULL; 45 return NULL;
46 } 46 }
47 47
48 GrTexture *tex = NULL; 48 GrTexture *tex = NULL;
49 if (GrPixelConfigIsCompressed(desc.fConfig)) { 49 if (GrPixelConfigIsCompressed(desc.fConfig)) {
50 // We shouldn't be rendering into this 50 // We shouldn't be rendering into this
51 SkASSERT((desc.fFlags & kRenderTarget_GrSurfaceFlag) == 0); 51 SkASSERT((desc.fFlags & kRenderTarget_GrSurfaceFlag) == 0);
52 52
53 if (!this->caps()->npotTextureTileSupport() && 53 if (!this->caps()->npotTextureTileSupport() &&
54 (!SkIsPow2(desc.fWidth) || !SkIsPow2(desc.fHeight))) { 54 (!SkIsPow2(desc.fWidth) || !SkIsPow2(desc.fHeight))) {
55 return NULL; 55 return NULL;
56 } 56 }
57 57
58 this->handleDirtyContext(); 58 this->handleDirtyContext();
59 tex = this->onCreateCompressedTexture(desc, srcData); 59 tex = this->onCreateCompressedTexture(desc, budgeted, srcData);
60 } else { 60 } else {
61 this->handleDirtyContext(); 61 this->handleDirtyContext();
62 tex = this->onCreateTexture(desc, srcData, rowBytes); 62 tex = this->onCreateTexture(desc, budgeted, srcData, rowBytes);
63 if (tex && 63 if (tex &&
64 (kRenderTarget_GrSurfaceFlag & desc.fFlags) && 64 (kRenderTarget_GrSurfaceFlag & desc.fFlags) &&
65 !(kNoStencil_GrSurfaceFlag & desc.fFlags)) { 65 !(kNoStencil_GrSurfaceFlag & desc.fFlags)) {
66 SkASSERT(tex->asRenderTarget()); 66 SkASSERT(tex->asRenderTarget());
67 // TODO: defer this and attach dynamically 67 // TODO: defer this and attach dynamically
68 if (!this->attachStencilBufferToRenderTarget(tex->asRenderTarget())) { 68 if (!this->attachStencilBufferToRenderTarget(tex->asRenderTarget())) {
69 tex->unref(); 69 tex->unref();
70 return NULL; 70 return NULL;
71 } 71 }
72 } 72 }
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 GrDrawTarget::PathIndexType indexType, 299 GrDrawTarget::PathIndexType indexType,
300 const float transformValues[], 300 const float transformValues[],
301 GrDrawTarget::PathTransformType transformType, 301 GrDrawTarget::PathTransformType transformType,
302 int count, 302 int count,
303 const GrStencilSettings& stencilSettings) { 303 const GrStencilSettings& stencilSettings) {
304 this->handleDirtyContext(); 304 this->handleDirtyContext();
305 pathRange->willDrawPaths(indices, indexType, count); 305 pathRange->willDrawPaths(indices, indexType, count);
306 this->onDrawPaths(ds, pathRange, indices, indexType, transformValues, 306 this->onDrawPaths(ds, pathRange, indices, indexType, transformValues,
307 transformType, count, stencilSettings); 307 transformType, count, stencilSettings);
308 } 308 }
OLDNEW
« no previous file with comments | « src/gpu/GrGpu.h ('k') | src/gpu/GrGpuResource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698