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

Side by Side Diff: include/gpu/GrContext.h

Issue 2163323002: Add desired width & height to drawContext (as opposed to using the width & height of the RT) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: More Clean up Created 4 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 | « no previous file | include/gpu/GrDrawContext.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 * 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 GrContext_DEFINED 8 #ifndef GrContext_DEFINED
9 #define GrContext_DEFINED 9 #define GrContext_DEFINED
10 10
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 * rendering quality for the display. Alternatively returns 0 if 177 * rendering quality for the display. Alternatively returns 0 if
178 * MSAA is not supported or recommended to be used by default. 178 * MSAA is not supported or recommended to be used by default.
179 */ 179 */
180 int getRecommendedSampleCount(GrPixelConfig config, SkScalar dpi) const; 180 int getRecommendedSampleCount(GrPixelConfig config, SkScalar dpi) const;
181 181
182 /** 182 /**
183 * Returns a helper object to orchestrate draws. 183 * Returns a helper object to orchestrate draws.
184 * Callers assume the creation ref of the drawContext 184 * Callers assume the creation ref of the drawContext
185 * NULL will be returned if the context has been abandoned. 185 * NULL will be returned if the context has been abandoned.
186 * 186 *
187 * @param width width of the portion of the rt that will actually be drawn to
188 * @param height height of the portion of the rt that will actually b e drawn to
187 * @param rt the render target receiving the draws 189 * @param rt the render target receiving the draws
188 * @param surfaceProps the surface properties (mainly defines text drawing) 190 * @param surfaceProps the surface properties (mainly defines text drawing)
189 * 191 *
190 * @return a draw context 192 * @return a draw context
191 */ 193 */
192 sk_sp<GrDrawContext> drawContext(sk_sp<GrRenderTarget> rt, const SkSurfacePr ops* = nullptr); 194 sk_sp<GrDrawContext> drawContext(int width, int height,
195 sk_sp<GrRenderTarget> rt,
196 const SkSurfaceProps* = nullptr);
193 197
194 /** 198 /**
195 * Create both a GrRenderTarget and a matching GrDrawContext to wrap it. 199 * Create both a GrRenderTarget and a matching GrDrawContext to wrap it.
196 * We guarantee that "asTexture" will succeed for drawContexts created 200 * We guarantee that "asTexture" will succeed for drawContexts created
197 * via this entry point. 201 * via this entry point.
198 */ 202 */
199 sk_sp<GrDrawContext> newDrawContext(SkBackingFit fit, 203 sk_sp<GrDrawContext> newDrawContext(SkBackingFit fit,
200 int width, int height, 204 int width, int height,
201 GrPixelConfig config, 205 GrPixelConfig config,
202 int sampleCnt = 0, 206 int sampleCnt = 0,
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 SkAutoTUnref<const GrCaps> fCaps; 498 SkAutoTUnref<const GrCaps> fCaps;
495 uint32_t fContextUniqueID; 499 uint32_t fContextUniqueID;
496 500
497 friend class GrContext; 501 friend class GrContext;
498 friend class SkImage; 502 friend class SkImage;
499 503
500 typedef SkRefCnt INHERITED; 504 typedef SkRefCnt INHERITED;
501 }; 505 };
502 506
503 #endif 507 #endif
OLDNEW
« no previous file with comments | « no previous file | include/gpu/GrDrawContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698