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

Side by Side Diff: tools/PictureRenderer.cpp

Issue 1205643002: Make SkGpuDevice know its alpha type (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix bench pictures :( Created 5 years, 5 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 | « tests/SurfaceTest.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 "PictureRenderer.h" 8 #include "PictureRenderer.h"
9 #include "picture_utils.h" 9 #include "picture_utils.h"
10 #include "SamplePipeControllers.h" 10 #include "SamplePipeControllers.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 desc.fConfig = kSkia8888_GrPixelConfig; 152 desc.fConfig = kSkia8888_GrPixelConfig;
153 desc.fFlags = kRenderTarget_GrSurfaceFlag; 153 desc.fFlags = kRenderTarget_GrSurfaceFlag;
154 desc.fWidth = width; 154 desc.fWidth = width;
155 desc.fHeight = height; 155 desc.fHeight = height;
156 desc.fSampleCnt = fSampleCount; 156 desc.fSampleCnt = fSampleCount;
157 target.reset(fGrContext->textureProvider()->createTexture(desc, false, NULL, 0)); 157 target.reset(fGrContext->textureProvider()->createTexture(desc, false, NULL, 0));
158 } 158 }
159 159
160 uint32_t flags = fUseDFText ? SkSurfaceProps::kUseDistanceFieldFonts _Flag : 0; 160 uint32_t flags = fUseDFText ? SkSurfaceProps::kUseDistanceFieldFonts _Flag : 0;
161 SkSurfaceProps props(flags, SkSurfaceProps::kLegacyFontHost_InitType ); 161 SkSurfaceProps props(flags, SkSurfaceProps::kLegacyFontHost_InitType );
162 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(target->asRende rTarget(), &props)); 162 SkAutoTUnref<SkGpuDevice> device(
163 SkGpuDevice::Create(target->asRenderTarget(), &props,
164 SkGpuDevice::kUninit_InitContents));
163 if (!device) { 165 if (!device) {
164 return NULL; 166 return NULL;
165 } 167 }
166 canvas.reset(SkNEW_ARGS(SkCanvas, (device))); 168 canvas.reset(SkNEW_ARGS(SkCanvas, (device)));
167 break; 169 break;
168 } 170 }
169 #endif 171 #endif
170 default: 172 default:
171 SkASSERT(0); 173 SkASSERT(0);
172 return NULL; 174 return NULL;
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after
819 case kNone_BBoxHierarchyType: 821 case kNone_BBoxHierarchyType:
820 return NULL; 822 return NULL;
821 case kRTree_BBoxHierarchyType: 823 case kRTree_BBoxHierarchyType:
822 return SkNEW(SkRTreeFactory); 824 return SkNEW(SkRTreeFactory);
823 } 825 }
824 SkASSERT(0); // invalid bbhType 826 SkASSERT(0); // invalid bbhType
825 return NULL; 827 return NULL;
826 } 828 }
827 829
828 } // namespace sk_tools 830 } // namespace sk_tools
OLDNEW
« no previous file with comments | « tests/SurfaceTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698