| 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/GrTextureDomainEffect.h" | 10 #include "effects/GrTextureDomainEffect.h" |
| (...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 506 copy.setColor(SkColorSetA(color, newA)); | 506 copy.setColor(SkColorSetA(color, newA)); |
| 507 return skPaint2GrPaintNoShader(dev, copy, false, constantColor, grPa
int); | 507 return skPaint2GrPaintNoShader(dev, copy, false, constantColor, grPa
int); |
| 508 } else { | 508 } else { |
| 509 return false; | 509 return false; |
| 510 } | 510 } |
| 511 } | 511 } |
| 512 } | 512 } |
| 513 } | 513 } |
| 514 | 514 |
| 515 /////////////////////////////////////////////////////////////////////////////// | 515 /////////////////////////////////////////////////////////////////////////////// |
| 516 void SkGpuDevice::getGlobalBounds(SkIRect* bounds) const { |
| 517 if (NULL != bounds) { |
| 518 const SkIPoint& origin = this->getOrigin(); |
| 519 bounds->setXYWH(origin.x(), origin.y(), |
| 520 this->width(), this->height()); |
| 521 } |
| 522 } |
| 516 | 523 |
| 517 SkBitmap::Config SkGpuDevice::config() const { | 524 SkBitmap::Config SkGpuDevice::config() const { |
| 518 if (NULL == fRenderTarget) { | 525 if (NULL == fRenderTarget) { |
| 519 return SkBitmap::kNo_Config; | 526 return SkBitmap::kNo_Config; |
| 520 } | 527 } |
| 521 | 528 |
| 522 bool isOpaque; | 529 bool isOpaque; |
| 523 return grConfig2skConfig(fRenderTarget->config(), &isOpaque); | 530 return grConfig2skConfig(fRenderTarget->config(), &isOpaque); |
| 524 } | 531 } |
| 525 | 532 |
| (...skipping 1317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1843 GrTexture* texture, | 1850 GrTexture* texture, |
| 1844 bool needClear) | 1851 bool needClear) |
| 1845 : SkBitmapDevice(make_bitmap(context, texture->asRenderTarget())) { | 1852 : SkBitmapDevice(make_bitmap(context, texture->asRenderTarget())) { |
| 1846 | 1853 |
| 1847 SkASSERT(texture && texture->asRenderTarget()); | 1854 SkASSERT(texture && texture->asRenderTarget()); |
| 1848 // This constructor is called from onCreateCompatibleDevice. It has locked t
he RT in the texture | 1855 // This constructor is called from onCreateCompatibleDevice. It has locked t
he RT in the texture |
| 1849 // cache. We pass true for the third argument so that it will get unlocked. | 1856 // cache. We pass true for the third argument so that it will get unlocked. |
| 1850 this->initFromRenderTarget(context, texture->asRenderTarget(), true); | 1857 this->initFromRenderTarget(context, texture->asRenderTarget(), true); |
| 1851 fNeedClear = needClear; | 1858 fNeedClear = needClear; |
| 1852 } | 1859 } |
| OLD | NEW |