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

Side by Side Diff: gm/xfermodes3.cpp

Issue 22978012: Split SkDevice into SkBaseDevice and SkBitmapDevice (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Updating to ToT (10994) Created 7 years, 3 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 | « gm/xfermodeimagefilter.cpp ('k') | include/core/SkBitmapDevice.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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 #if SK_SUPPORT_GPU 125 #if SK_SUPPORT_GPU
126 GrRenderTarget* rt = baseCanvas->getDevice()->accessRenderTarget(); 126 GrRenderTarget* rt = baseCanvas->getDevice()->accessRenderTarget();
127 if (NULL != rt) { 127 if (NULL != rt) {
128 GrContext* context = rt->getContext(); 128 GrContext* context = rt->getContext();
129 GrTextureDesc desc; 129 GrTextureDesc desc;
130 desc.fWidth = w; 130 desc.fWidth = w;
131 desc.fHeight = h; 131 desc.fHeight = h;
132 desc.fConfig = rt->config(); 132 desc.fConfig = rt->config();
133 desc.fFlags = kRenderTarget_GrTextureFlagBit; 133 desc.fFlags = kRenderTarget_GrTextureFlagBit;
134 SkAutoTUnref<GrSurface> surface(context->createUncachedTexture(desc, NULL, 0)); 134 SkAutoTUnref<GrSurface> surface(context->createUncachedTexture(desc, NULL, 0));
135 SkAutoTUnref<SkDevice> device(SkGpuDevice::Create(surface.get())); 135 SkAutoTUnref<SkBaseDevice> device(SkGpuDevice::Create(surface.get()) );
136 if (NULL != device.get()) { 136 if (NULL != device.get()) {
137 tempCanvas = SkNEW_ARGS(SkCanvas, (device.get())); 137 tempCanvas = SkNEW_ARGS(SkCanvas, (device.get()));
138 } 138 }
139 } 139 }
140 #endif 140 #endif
141 return tempCanvas; 141 return tempCanvas;
142 } 142 }
143 143
144 void drawMode(SkCanvas* canvas, 144 void drawMode(SkCanvas* canvas,
145 int x, int y, int w, int h, 145 int x, int y, int w, int h,
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 SkAutoTUnref<SkShader> fBmpShader; 237 SkAutoTUnref<SkShader> fBmpShader;
238 238
239 typedef GM INHERITED; 239 typedef GM INHERITED;
240 }; 240 };
241 241
242 ////////////////////////////////////////////////////////////////////////////// 242 //////////////////////////////////////////////////////////////////////////////
243 243
244 DEF_GM(return new Xfermodes3GM;) 244 DEF_GM(return new Xfermodes3GM;)
245 245
246 } 246 }
OLDNEW
« no previous file with comments | « gm/xfermodeimagefilter.cpp ('k') | include/core/SkBitmapDevice.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698