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

Side by Side Diff: include/core/SkSurface.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 | « 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 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 #ifndef SkSurface_DEFINED 8 #ifndef SkSurface_DEFINED
9 #define SkSurface_DEFINED 9 #define SkSurface_DEFINED
10 10
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 static sk_sp<SkSurface> MakeFromBackendTextureAsRenderTarget( 133 static sk_sp<SkSurface> MakeFromBackendTextureAsRenderTarget(
134 GrContext* ctx, const GrBackendTextureDesc& desc, const SkSurfacePro ps* props) { 134 GrContext* ctx, const GrBackendTextureDesc& desc, const SkSurfacePro ps* props) {
135 return MakeFromBackendTextureAsRenderTarget(ctx, desc, nullptr, props); 135 return MakeFromBackendTextureAsRenderTarget(ctx, desc, nullptr, props);
136 } 136 }
137 137
138 138
139 /** 139 /**
140 * Return a new surface whose contents will be drawn to an offscreen 140 * Return a new surface whose contents will be drawn to an offscreen
141 * render target, allocated by the surface. 141 * render target, allocated by the surface.
142 */ 142 */
143 static sk_sp<SkSurface> MakeRenderTarget( 143 static sk_sp<SkSurface> MakeRenderTarget(GrContext*, SkBudgeted, const SkIma geInfo&,
144 GrContext*, SkBudgeted, const SkImageInfo&, int sampleCount, const S kSurfaceProps*); 144 int sampleCount, GrSurfaceOrigin,
145 const SkSurfaceProps*);
146
147 static sk_sp<SkSurface> MakeRenderTarget(GrContext* context, SkBudgeted budg eted,
148 const SkImageInfo& info, int sample Count,
149 const SkSurfaceProps* props) {
150 return MakeRenderTarget(context, budgeted, info, sampleCount,
151 kBottomLeft_GrSurfaceOrigin, props);
152 }
145 153
146 static sk_sp<SkSurface> MakeRenderTarget(GrContext* gr, SkBudgeted b, const SkImageInfo& info) { 154 static sk_sp<SkSurface> MakeRenderTarget(GrContext* gr, SkBudgeted b, const SkImageInfo& info) {
147 return MakeRenderTarget(gr, b, info, 0, nullptr); 155 return MakeRenderTarget(gr, b, info, 0, kBottomLeft_GrSurfaceOrigin, nul lptr);
148 } 156 }
149 157
150 #ifdef SK_SUPPORT_LEGACY_NEW_SURFACE_API 158 #ifdef SK_SUPPORT_LEGACY_NEW_SURFACE_API
151 static SkSurface* NewRasterDirect(const SkImageInfo& info, void* pixels, siz e_t rowBytes, 159 static SkSurface* NewRasterDirect(const SkImageInfo& info, void* pixels, siz e_t rowBytes,
152 const SkSurfaceProps* props = NULL) { 160 const SkSurfaceProps* props = NULL) {
153 return MakeRasterDirect(info, pixels, rowBytes, props).release(); 161 return MakeRasterDirect(info, pixels, rowBytes, props).release();
154 } 162 }
155 static SkSurface* NewRasterDirectReleaseProc(const SkImageInfo& info, void* pixels, 163 static SkSurface* NewRasterDirectReleaseProc(const SkImageInfo& info, void* pixels,
156 size_t rowBytes, 164 size_t rowBytes,
157 void (*releaseProc)(void* pixel s, void* context), 165 void (*releaseProc)(void* pixel s, void* context),
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 private: 401 private:
394 const SkSurfaceProps fProps; 402 const SkSurfaceProps fProps;
395 const int fWidth; 403 const int fWidth;
396 const int fHeight; 404 const int fHeight;
397 uint32_t fGenerationID; 405 uint32_t fGenerationID;
398 406
399 typedef SkRefCnt INHERITED; 407 typedef SkRefCnt INHERITED;
400 }; 408 };
401 409
402 #endif 410 #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