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

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

Issue 1116453002: onCreateDevice -> NULL now means the caller should create its own (bitmap) device (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update dox Created 5 years, 7 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 | « src/core/SkDeviceImageFilterProxy.h ('k') | src/pdf/SkPDFDevice.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 2011 Google Inc. 2 * Copyright 2011 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 "SkGpuDevice.h" 8 #include "SkGpuDevice.h"
9 9
10 #include "GrContext.h" 10 #include "GrContext.h"
(...skipping 1941 matching lines...) Expand 10 before | Expand all | Expand 10 after
1952 GrContext::kApprox_ScratchTexMat ch : 1952 GrContext::kApprox_ScratchTexMat ch :
1953 GrContext::kExact_ScratchTexMatc h; 1953 GrContext::kExact_ScratchTexMatc h;
1954 texture.reset(fContext->refScratchTexture(desc, match)); 1954 texture.reset(fContext->refScratchTexture(desc, match));
1955 1955
1956 if (texture) { 1956 if (texture) {
1957 SkSurfaceProps props(fSurfaceProps.flags(), cinfo.fPixelGeometry); 1957 SkSurfaceProps props(fSurfaceProps.flags(), cinfo.fPixelGeometry);
1958 return SkGpuDevice::Create( 1958 return SkGpuDevice::Create(
1959 texture->asRenderTarget(), cinfo.fInfo.width(), cinfo.fInfo.height() , &props, flags); 1959 texture->asRenderTarget(), cinfo.fInfo.width(), cinfo.fInfo.height() , &props, flags);
1960 } else { 1960 } else {
1961 SkErrorInternals::SetError( kInternalError_SkError, 1961 SkErrorInternals::SetError( kInternalError_SkError,
1962 "---- failed to create compatible device tex ture [%d %d]\n", 1962 "---- failed to create gpu device texture [% d %d]\n",
1963 cinfo.fInfo.width(), cinfo.fInfo.height()); 1963 cinfo.fInfo.width(), cinfo.fInfo.height());
1964 return NULL; 1964 return NULL;
1965 } 1965 }
1966 } 1966 }
1967 1967
1968 SkSurface* SkGpuDevice::newSurface(const SkImageInfo& info, const SkSurfaceProps & props) { 1968 SkSurface* SkGpuDevice::newSurface(const SkImageInfo& info, const SkSurfaceProps & props) {
1969 // TODO: Change the signature of newSurface to take a budgeted parameter. 1969 // TODO: Change the signature of newSurface to take a budgeted parameter.
1970 static const SkSurface::Budgeted kBudgeted = SkSurface::kNo_Budgeted; 1970 static const SkSurface::Budgeted kBudgeted = SkSurface::kNo_Budgeted;
1971 return SkSurface::NewRenderTarget(fContext, kBudgeted, info, fRenderTarget-> numSamples(), 1971 return SkSurface::NewRenderTarget(fContext, kBudgeted, info, fRenderTarget-> numSamples(),
1972 &props); 1972 &props);
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
2038 #endif 2038 #endif
2039 } 2039 }
2040 2040
2041 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { 2041 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() {
2042 // We always return a transient cache, so it is freed after each 2042 // We always return a transient cache, so it is freed after each
2043 // filter traversal. 2043 // filter traversal.
2044 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); 2044 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize);
2045 } 2045 }
2046 2046
2047 #endif 2047 #endif
OLDNEW
« no previous file with comments | « src/core/SkDeviceImageFilterProxy.h ('k') | src/pdf/SkPDFDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698