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

Side by Side Diff: gm/xfermodes3.cpp

Issue 682223002: rename GrTextureDesc->GrSurfaceDesc, GrTextureFlags->GrSurfaceFlags (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: const Created 6 years, 1 month 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 | « gm/texdata.cpp ('k') | include/gpu/GrContext.h » ('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 2013 Google Inc. 3 * Copyright 2013 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 #include "gm.h" 8 #include "gm.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkGradientShader.h" 10 #include "SkGradientShader.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 * saveLayer() uses the texture cache. This means that the actual render tar get may be larger 119 * saveLayer() uses the texture cache. This means that the actual render tar get may be larger
120 * than the layer. Because the clip will contain the layer's bounds, no draw s will be full-RT. 120 * than the layer. Because the clip will contain the layer's bounds, no draw s will be full-RT.
121 * So when running on a GPU canvas we explicitly create a temporary canvas u sing a texture with 121 * So when running on a GPU canvas we explicitly create a temporary canvas u sing a texture with
122 * dimensions exactly matching the layer size. 122 * dimensions exactly matching the layer size.
123 */ 123 */
124 SkCanvas* possiblyCreateTempCanvas(SkCanvas* baseCanvas, int w, int h) { 124 SkCanvas* possiblyCreateTempCanvas(SkCanvas* baseCanvas, int w, int h) {
125 SkCanvas* tempCanvas = NULL; 125 SkCanvas* tempCanvas = NULL;
126 #if SK_SUPPORT_GPU 126 #if SK_SUPPORT_GPU
127 GrContext* context = baseCanvas->getGrContext(); 127 GrContext* context = baseCanvas->getGrContext();
128 if (context) { 128 if (context) {
129 GrTextureDesc desc; 129 GrSurfaceDesc desc;
130 desc.fWidth = w; 130 desc.fWidth = w;
131 desc.fHeight = h; 131 desc.fHeight = h;
132 desc.fConfig = SkImageInfo2GrPixelConfig(baseCanvas->imageInfo()); 132 desc.fConfig = SkImageInfo2GrPixelConfig(baseCanvas->imageInfo());
133 desc.fFlags = kRenderTarget_GrTextureFlagBit; 133 desc.fFlags = kRenderTarget_GrSurfaceFlag;
134 SkAutoTUnref<GrSurface> surface(context->createUncachedTexture(desc, NULL, 0)); 134 SkAutoTUnref<GrSurface> surface(context->createUncachedTexture(desc, NULL, 0));
135 SkAutoTUnref<SkBaseDevice> device(SkGpuDevice::Create(surface.get(), 135 SkAutoTUnref<SkBaseDevice> device(SkGpuDevice::Create(surface.get(),
136 SkSurfaceProps(SkSurfaceProps::kLegacy FontHost_InitType))); 136 SkSurfaceProps(SkSurfaceProps::kLegacy FontHost_InitType)));
137 if (device.get()) { 137 if (device.get()) {
138 tempCanvas = SkNEW_ARGS(SkCanvas, (device.get())); 138 tempCanvas = SkNEW_ARGS(SkCanvas, (device.get()));
139 } 139 }
140 } 140 }
141 #endif 141 #endif
142 return tempCanvas; 142 return tempCanvas;
143 } 143 }
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 SkAutoTUnref<SkShader> fBmpShader; 238 SkAutoTUnref<SkShader> fBmpShader;
239 239
240 typedef GM INHERITED; 240 typedef GM INHERITED;
241 }; 241 };
242 242
243 ////////////////////////////////////////////////////////////////////////////// 243 //////////////////////////////////////////////////////////////////////////////
244 244
245 DEF_GM(return new Xfermodes3GM;) 245 DEF_GM(return new Xfermodes3GM;)
246 246
247 } 247 }
OLDNEW
« no previous file with comments | « gm/texdata.cpp ('k') | include/gpu/GrContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698