| 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 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 | 355 #ifdef SK_SUPPORT_LEGACY_DEVICE_CONFIG |
| 356 SkBitmap::Config SkGpuDevice::config() const { | 356 SkBitmap::Config SkGpuDevice::config() const { |
| 357 if (NULL == fRenderTarget) { | 357 if (NULL == fRenderTarget) { |
| 358 return SkBitmap::kNo_Config; | 358 return SkBitmap::kNo_Config; |
| 359 } | 359 } |
| 360 | 360 return SkColorTypeToBitmapConfig(fRenderTarget->info().colorType()); |
| 361 bool isOpaque; | |
| 362 return grConfig2skConfig(fRenderTarget->config(), &isOpaque); | |
| 363 } | 361 } |
| 364 #endif | 362 #endif |
| 365 | 363 |
| 366 void SkGpuDevice::clear(SkColor color) { | 364 void SkGpuDevice::clear(SkColor color) { |
| 367 SkIRect rect = SkIRect::MakeWH(this->width(), this->height()); | 365 SkIRect rect = SkIRect::MakeWH(this->width(), this->height()); |
| 368 fContext->clear(&rect, SkColor2GrColor(color), true, fRenderTarget); | 366 fContext->clear(&rect, SkColor2GrColor(color), true, fRenderTarget); |
| 369 fNeedClear = false; | 367 fNeedClear = false; |
| 370 } | 368 } |
| 371 | 369 |
| 372 void SkGpuDevice::drawPaint(const SkDraw& draw, const SkPaint& paint) { | 370 void SkGpuDevice::drawPaint(const SkDraw& draw, const SkPaint& paint) { |
| (...skipping 1603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1976 GrCachedLayer* layer = fContext->getLayerCache()->findLayerOrCreate(pict
ure, i); | 1974 GrCachedLayer* layer = fContext->getLayerCache()->findLayerOrCreate(pict
ure, i); |
| 1977 | 1975 |
| 1978 if (NULL != layer->getTexture()) { | 1976 if (NULL != layer->getTexture()) { |
| 1979 fContext->unlockScratchTexture(layer->getTexture()); | 1977 fContext->unlockScratchTexture(layer->getTexture()); |
| 1980 layer->setTexture(NULL); | 1978 layer->setTexture(NULL); |
| 1981 } | 1979 } |
| 1982 } | 1980 } |
| 1983 | 1981 |
| 1984 return true; | 1982 return true; |
| 1985 } | 1983 } |
| OLD | NEW |