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

Side by Side Diff: src/image/SkSurface_Gpu.cpp

Issue 15643013: Force checking of all color, stencil and FBO allocations for SkSurface_Gpu. This fixes the software… (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Spread the SkToBool goodness. Created 7 years, 6 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/gl/GrGpuGL.cpp ('k') | no next file » | 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 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkSurface_Base.h" 8 #include "SkSurface_Base.h"
9 #include "SkImagePriv.h" 9 #include "SkImagePriv.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 119
120 SkSurface* SkSurface::NewRenderTarget(GrContext* ctx, const SkImage::Info& info, int sampleCount) { 120 SkSurface* SkSurface::NewRenderTarget(GrContext* ctx, const SkImage::Info& info, int sampleCount) {
121 if (NULL == ctx) { 121 if (NULL == ctx) {
122 return NULL; 122 return NULL;
123 } 123 }
124 124
125 bool isOpaque; 125 bool isOpaque;
126 SkBitmap::Config config = SkImageInfoToBitmapConfig(info, &isOpaque); 126 SkBitmap::Config config = SkImageInfoToBitmapConfig(info, &isOpaque);
127 127
128 GrTextureDesc desc; 128 GrTextureDesc desc;
129 desc.fFlags = kRenderTarget_GrTextureFlagBit; 129 desc.fFlags = kRenderTarget_GrTextureFlagBit | kCheckAllocation_GrTextureFla gBit;
130 desc.fWidth = info.fWidth; 130 desc.fWidth = info.fWidth;
131 desc.fHeight = info.fHeight; 131 desc.fHeight = info.fHeight;
132 desc.fConfig = SkBitmapConfig2GrPixelConfig(config); 132 desc.fConfig = SkBitmapConfig2GrPixelConfig(config);
133 desc.fSampleCnt = sampleCount; 133 desc.fSampleCnt = sampleCount;
134 134
135 SkAutoTUnref<GrTexture> tex(ctx->createUncachedTexture(desc, NULL, 0)); 135 SkAutoTUnref<GrTexture> tex(ctx->createUncachedTexture(desc, NULL, 0));
136 if (NULL == tex) { 136 if (NULL == tex) {
137 return NULL; 137 return NULL;
138 } 138 }
139 139
140 return SkNEW_ARGS(SkSurface_Gpu, (ctx, tex->asRenderTarget())); 140 return SkNEW_ARGS(SkSurface_Gpu, (ctx, tex->asRenderTarget()));
141 } 141 }
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGpuGL.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698