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 "GrBitmapTextContext.h" | 10 #include "GrBitmapTextContext.h" |
(...skipping 1936 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1947 GrContext::kApprox_ScratchTexMat
ch : | 1947 GrContext::kApprox_ScratchTexMat
ch : |
1948 GrContext::kExact_ScratchTexMatc
h; | 1948 GrContext::kExact_ScratchTexMatc
h; |
1949 texture.reset(fContext->refScratchTexture(desc, match)); | 1949 texture.reset(fContext->refScratchTexture(desc, match)); |
1950 | 1950 |
1951 if (texture) { | 1951 if (texture) { |
1952 SkSurfaceProps props(fSurfaceProps.flags(), cinfo.fPixelGeometry); | 1952 SkSurfaceProps props(fSurfaceProps.flags(), cinfo.fPixelGeometry); |
1953 return SkGpuDevice::Create( | 1953 return SkGpuDevice::Create( |
1954 texture->asRenderTarget(), cinfo.fInfo.width(), cinfo.fInfo.height()
, &props, flags); | 1954 texture->asRenderTarget(), cinfo.fInfo.width(), cinfo.fInfo.height()
, &props, flags); |
1955 } else { | 1955 } else { |
1956 SkErrorInternals::SetError( kInternalError_SkError, | 1956 SkErrorInternals::SetError( kInternalError_SkError, |
1957 "---- failed to create compatible device tex
ture [%d %d]\n", | 1957 "---- failed to create gpu device texture [%
d %d]\n", |
1958 cinfo.fInfo.width(), cinfo.fInfo.height()); | 1958 cinfo.fInfo.width(), cinfo.fInfo.height()); |
1959 return NULL; | 1959 return NULL; |
1960 } | 1960 } |
1961 } | 1961 } |
1962 | 1962 |
1963 SkSurface* SkGpuDevice::newSurface(const SkImageInfo& info, const SkSurfaceProps
& props) { | 1963 SkSurface* SkGpuDevice::newSurface(const SkImageInfo& info, const SkSurfaceProps
& props) { |
1964 // TODO: Change the signature of newSurface to take a budgeted parameter. | 1964 // TODO: Change the signature of newSurface to take a budgeted parameter. |
1965 static const SkSurface::Budgeted kBudgeted = SkSurface::kNo_Budgeted; | 1965 static const SkSurface::Budgeted kBudgeted = SkSurface::kNo_Budgeted; |
1966 return SkSurface::NewRenderTarget(fContext, kBudgeted, info, fRenderTarget->
numSamples(), | 1966 return SkSurface::NewRenderTarget(fContext, kBudgeted, info, fRenderTarget->
numSamples(), |
1967 &props); | 1967 &props); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2033 #endif | 2033 #endif |
2034 } | 2034 } |
2035 | 2035 |
2036 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { | 2036 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { |
2037 // We always return a transient cache, so it is freed after each | 2037 // We always return a transient cache, so it is freed after each |
2038 // filter traversal. | 2038 // filter traversal. |
2039 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); | 2039 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); |
2040 } | 2040 } |
2041 | 2041 |
2042 #endif | 2042 #endif |
OLD | NEW |