| 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 "effects/GrBicubicEffect.h" | 10 #include "effects/GrBicubicEffect.h" |
| (...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 SK_COMPILE_ASSERT(SkShader::kSweep_BitmapType == 3, shader_type_mismatch); | 345 SK_COMPILE_ASSERT(SkShader::kSweep_BitmapType == 3, shader_type_mismatch); |
| 346 SK_COMPILE_ASSERT(SkShader::kTwoPointRadial_BitmapType == 4, | 346 SK_COMPILE_ASSERT(SkShader::kTwoPointRadial_BitmapType == 4, |
| 347 shader_type_mismatch); | 347 shader_type_mismatch); |
| 348 SK_COMPILE_ASSERT(SkShader::kTwoPointConical_BitmapType == 5, | 348 SK_COMPILE_ASSERT(SkShader::kTwoPointConical_BitmapType == 5, |
| 349 shader_type_mismatch); | 349 shader_type_mismatch); |
| 350 SK_COMPILE_ASSERT(SkShader::kLinear_BitmapType == 6, shader_type_mismatch); | 350 SK_COMPILE_ASSERT(SkShader::kLinear_BitmapType == 6, shader_type_mismatch); |
| 351 SK_COMPILE_ASSERT(SkShader::kLast_BitmapType == 6, shader_type_mismatch); | 351 SK_COMPILE_ASSERT(SkShader::kLast_BitmapType == 6, shader_type_mismatch); |
| 352 | 352 |
| 353 /////////////////////////////////////////////////////////////////////////////// | 353 /////////////////////////////////////////////////////////////////////////////// |
| 354 | 354 |
| 355 #ifdef SK_SUPPORT_LEGACY_DEVICE_CONFIG | |
| 356 SkBitmap::Config SkGpuDevice::config() const { | |
| 357 if (NULL == fRenderTarget) { | |
| 358 return SkBitmap::kNo_Config; | |
| 359 } | |
| 360 return SkColorTypeToBitmapConfig(fRenderTarget->info().colorType()); | |
| 361 } | |
| 362 #endif | |
| 363 | |
| 364 void SkGpuDevice::clear(SkColor color) { | 355 void SkGpuDevice::clear(SkColor color) { |
| 365 SkIRect rect = SkIRect::MakeWH(this->width(), this->height()); | 356 SkIRect rect = SkIRect::MakeWH(this->width(), this->height()); |
| 366 fContext->clear(&rect, SkColor2GrColor(color), true, fRenderTarget); | 357 fContext->clear(&rect, SkColor2GrColor(color), true, fRenderTarget); |
| 367 fNeedClear = false; | 358 fNeedClear = false; |
| 368 } | 359 } |
| 369 | 360 |
| 370 void SkGpuDevice::drawPaint(const SkDraw& draw, const SkPaint& paint) { | 361 void SkGpuDevice::drawPaint(const SkDraw& draw, const SkPaint& paint) { |
| 371 CHECK_SHOULD_DRAW(draw, false); | 362 CHECK_SHOULD_DRAW(draw, false); |
| 372 | 363 |
| 373 GrPaint grPaint; | 364 GrPaint grPaint; |
| (...skipping 1605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1979 GrCachedLayer* layer = fContext->getLayerCache()->findLayerOrCreate(pict
ure, i); | 1970 GrCachedLayer* layer = fContext->getLayerCache()->findLayerOrCreate(pict
ure, i); |
| 1980 | 1971 |
| 1981 if (NULL != layer->getTexture()) { | 1972 if (NULL != layer->getTexture()) { |
| 1982 fContext->unlockScratchTexture(layer->getTexture()); | 1973 fContext->unlockScratchTexture(layer->getTexture()); |
| 1983 layer->setTexture(NULL); | 1974 layer->setTexture(NULL); |
| 1984 } | 1975 } |
| 1985 } | 1976 } |
| 1986 | 1977 |
| 1987 return true; | 1978 return true; |
| 1988 } | 1979 } |
| OLD | NEW |