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

Side by Side Diff: src/image/SkSurface_Gpu.cpp

Issue 141063004: remove unneeded SK_SUPPORT_LEGACY_NEWRENDERTARGETDIRECT (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 10 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 | « include/core/SkSurface.h ('k') | no next file » | 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 #include "SkSurface_Base.h" 8 #include "SkSurface_Base.h"
9 #include "SkImagePriv.h" 9 #include "SkImagePriv.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 102
103 /////////////////////////////////////////////////////////////////////////////// 103 ///////////////////////////////////////////////////////////////////////////////
104 104
105 SkSurface* SkSurface::NewRenderTargetDirect(GrRenderTarget* target) { 105 SkSurface* SkSurface::NewRenderTargetDirect(GrRenderTarget* target) {
106 if (NULL == target) { 106 if (NULL == target) {
107 return NULL; 107 return NULL;
108 } 108 }
109 return SkNEW_ARGS(SkSurface_Gpu, (target)); 109 return SkNEW_ARGS(SkSurface_Gpu, (target));
110 } 110 }
111 111
112 #ifdef SK_SUPPORT_LEGACY_NEWRENDERTARGETDIRECT
113 SkSurface* SkSurface::NewRenderTargetDirect(GrContext* ctx,
114 GrRenderTarget* target) {
115 SkASSERT(target->getContext() == ctx);
116 return SkSurface::NewRenderTargetDirect(target);
117 }
118 #endif
119
120 SkSurface* SkSurface::NewRenderTarget(GrContext* ctx, const SkImageInfo& info, i nt sampleCount) { 112 SkSurface* SkSurface::NewRenderTarget(GrContext* ctx, const SkImageInfo& info, i nt sampleCount) {
121 if (NULL == ctx) { 113 if (NULL == ctx) {
122 return NULL; 114 return NULL;
123 } 115 }
124 116
125 SkBitmap::Config config = SkImageInfoToBitmapConfig(info); 117 SkBitmap::Config config = SkImageInfoToBitmapConfig(info);
126 118
127 GrTextureDesc desc; 119 GrTextureDesc desc;
128 desc.fFlags = kRenderTarget_GrTextureFlagBit | kCheckAllocation_GrTextureFla gBit; 120 desc.fFlags = kRenderTarget_GrTextureFlagBit | kCheckAllocation_GrTextureFla gBit;
129 desc.fWidth = info.fWidth; 121 desc.fWidth = info.fWidth;
130 desc.fHeight = info.fHeight; 122 desc.fHeight = info.fHeight;
131 desc.fConfig = SkBitmapConfig2GrPixelConfig(config); 123 desc.fConfig = SkBitmapConfig2GrPixelConfig(config);
132 desc.fSampleCnt = sampleCount; 124 desc.fSampleCnt = sampleCount;
133 125
134 SkAutoTUnref<GrTexture> tex(ctx->createUncachedTexture(desc, NULL, 0)); 126 SkAutoTUnref<GrTexture> tex(ctx->createUncachedTexture(desc, NULL, 0));
135 if (NULL == tex) { 127 if (NULL == tex) {
136 return NULL; 128 return NULL;
137 } 129 }
138 130
139 return SkNEW_ARGS(SkSurface_Gpu, (tex->asRenderTarget())); 131 return SkNEW_ARGS(SkSurface_Gpu, (tex->asRenderTarget()));
140 } 132 }
OLDNEW
« no previous file with comments | « include/core/SkSurface.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698