OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |