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

Side by Side Diff: src/gpu/SkGpuDevice.h

Issue 2187573002: Reduce usage of MakeRenderTargetDirect (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Clean up Created 4 years, 4 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 | « include/gpu/GrDrawContext.h ('k') | src/gpu/SkGpuDevice.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 * Copyright 2010 Google Inc. 2 * Copyright 2010 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 #ifndef SkGpuDevice_DEFINED 8 #ifndef SkGpuDevice_DEFINED
9 #define SkGpuDevice_DEFINED 9 #define SkGpuDevice_DEFINED
10 10
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 static sk_sp<SkBaseDevice> Make(sk_sp<GrDrawContext> drawContext, 55 static sk_sp<SkBaseDevice> Make(sk_sp<GrDrawContext> drawContext,
56 int width, int height, 56 int width, int height,
57 InitContents); 57 InitContents);
58 58
59 /** 59 /**
60 * New device that will create an offscreen renderTarget based on the ImageI nfo and 60 * New device that will create an offscreen renderTarget based on the ImageI nfo and
61 * sampleCount. The Budgeted param controls whether the device's backing sto re counts against 61 * sampleCount. The Budgeted param controls whether the device's backing sto re counts against
62 * the resource cache budget. On failure, returns nullptr. 62 * the resource cache budget. On failure, returns nullptr.
63 */ 63 */
64 static sk_sp<SkGpuDevice> Make(GrContext*, SkBudgeted, const SkImageInfo&, 64 static sk_sp<SkGpuDevice> Make(GrContext*, SkBudgeted, const SkImageInfo&,
65 int sampleCount, const SkSurfaceProps*, InitC ontents); 65 int sampleCount, GrSurfaceOrigin,
66 const SkSurfaceProps*, InitContents);
66 67
67 ~SkGpuDevice() override {} 68 ~SkGpuDevice() override {}
68 69
69 SkGpuDevice* cloneDevice(const SkSurfaceProps& props) { 70 SkGpuDevice* cloneDevice(const SkSurfaceProps& props) {
70 SkBaseDevice* dev = this->onCreateDevice(CreateInfo(this->imageInfo(), k Possible_TileUsage, 71 SkBaseDevice* dev = this->onCreateDevice(CreateInfo(this->imageInfo(), k Possible_TileUsage,
71 props.pixelGeometry( )), 72 props.pixelGeometry( )),
72 nullptr); 73 nullptr);
73 return static_cast<SkGpuDevice*>(dev); 74 return static_cast<SkGpuDevice*>(dev);
74 } 75 }
75 76
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 259
259 bool drawFilledDRRect(const SkMatrix& viewMatrix, const SkRRect& outer, 260 bool drawFilledDRRect(const SkMatrix& viewMatrix, const SkRRect& outer,
260 const SkRRect& inner, const SkPaint& paint); 261 const SkRRect& inner, const SkPaint& paint);
261 262
262 void drawProducerNine(const SkDraw&, GrTextureProducer*, const SkIRect& cent er, 263 void drawProducerNine(const SkDraw&, GrTextureProducer*, const SkIRect& cent er,
263 const SkRect& dst, const SkPaint&); 264 const SkRect& dst, const SkPaint&);
264 265
265 bool drawDashLine(const SkPoint pts[2], const SkPaint& paint); 266 bool drawDashLine(const SkPoint pts[2], const SkPaint& paint);
266 void drawStrokedLine(const SkPoint pts[2], const SkDraw&, const SkPaint&); 267 void drawStrokedLine(const SkPoint pts[2], const SkDraw&, const SkPaint&);
267 268
268 static sk_sp<GrDrawContext> CreateDrawContext(GrContext*, 269 static sk_sp<GrDrawContext> MakeDrawContext(GrContext*,
269 SkBudgeted, 270 SkBudgeted,
270 const SkImageInfo&, 271 const SkImageInfo&,
271 int sampleCount, 272 int sampleCount,
272 const SkSurfaceProps*); 273 GrSurfaceOrigin,
274 const SkSurfaceProps*);
273 275
274 friend class GrAtlasTextContext; 276 friend class GrAtlasTextContext;
275 friend class SkSurface_Gpu; // for access to surfaceProps 277 friend class SkSurface_Gpu; // for access to surfaceProps
276 typedef SkBaseDevice INHERITED; 278 typedef SkBaseDevice INHERITED;
277 }; 279 };
278 280
279 #endif 281 #endif
OLDNEW
« no previous file with comments | « include/gpu/GrDrawContext.h ('k') | src/gpu/SkGpuDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698