| 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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 SkPixelRef* pr = SkNEW_ARGS(SkGrPixelRef, (fRenderTarget->surfacePriv().info
(), fRenderTarget)); | 344 SkPixelRef* pr = SkNEW_ARGS(SkGrPixelRef, (fRenderTarget->surfacePriv().info
(), fRenderTarget)); |
| 345 fLegacyBitmap.setPixelRef(pr)->unref(); | 345 fLegacyBitmap.setPixelRef(pr)->unref(); |
| 346 } | 346 } |
| 347 | 347 |
| 348 /////////////////////////////////////////////////////////////////////////////// | 348 /////////////////////////////////////////////////////////////////////////////// |
| 349 | 349 |
| 350 SK_COMPILE_ASSERT(SkShader::kNone_BitmapType == 0, shader_type_mismatch); | 350 SK_COMPILE_ASSERT(SkShader::kNone_BitmapType == 0, shader_type_mismatch); |
| 351 SK_COMPILE_ASSERT(SkShader::kDefault_BitmapType == 1, shader_type_mismatch); | 351 SK_COMPILE_ASSERT(SkShader::kDefault_BitmapType == 1, shader_type_mismatch); |
| 352 SK_COMPILE_ASSERT(SkShader::kRadial_BitmapType == 2, shader_type_mismatch); | 352 SK_COMPILE_ASSERT(SkShader::kRadial_BitmapType == 2, shader_type_mismatch); |
| 353 SK_COMPILE_ASSERT(SkShader::kSweep_BitmapType == 3, shader_type_mismatch); | 353 SK_COMPILE_ASSERT(SkShader::kSweep_BitmapType == 3, shader_type_mismatch); |
| 354 SK_COMPILE_ASSERT(SkShader::kTwoPointRadial_BitmapType == 4, | 354 SK_COMPILE_ASSERT(SkShader::kTwoPointConical_BitmapType == 4, |
| 355 shader_type_mismatch); | 355 shader_type_mismatch); |
| 356 SK_COMPILE_ASSERT(SkShader::kTwoPointConical_BitmapType == 5, | 356 SK_COMPILE_ASSERT(SkShader::kLinear_BitmapType == 5, shader_type_mismatch); |
| 357 shader_type_mismatch); | 357 SK_COMPILE_ASSERT(SkShader::kLast_BitmapType == 5, shader_type_mismatch); |
| 358 SK_COMPILE_ASSERT(SkShader::kLinear_BitmapType == 6, shader_type_mismatch); | |
| 359 SK_COMPILE_ASSERT(SkShader::kLast_BitmapType == 6, shader_type_mismatch); | |
| 360 | 358 |
| 361 /////////////////////////////////////////////////////////////////////////////// | 359 /////////////////////////////////////////////////////////////////////////////// |
| 362 | 360 |
| 363 void SkGpuDevice::drawPaint(const SkDraw& draw, const SkPaint& paint) { | 361 void SkGpuDevice::drawPaint(const SkDraw& draw, const SkPaint& paint) { |
| 364 CHECK_SHOULD_DRAW(draw); | 362 CHECK_SHOULD_DRAW(draw); |
| 365 GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice::drawPaint", fContext); | 363 GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice::drawPaint", fContext); |
| 366 | 364 |
| 367 GrPaint grPaint; | 365 GrPaint grPaint; |
| 368 if (!SkPaint2GrPaint(this->context(), fRenderTarget, paint, *draw.fMatrix, t
rue, &grPaint)) { | 366 if (!SkPaint2GrPaint(this->context(), fRenderTarget, paint, *draw.fMatrix, t
rue, &grPaint)) { |
| 369 return; | 367 return; |
| (...skipping 1673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2043 #endif | 2041 #endif |
| 2044 } | 2042 } |
| 2045 | 2043 |
| 2046 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { | 2044 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { |
| 2047 // We always return a transient cache, so it is freed after each | 2045 // We always return a transient cache, so it is freed after each |
| 2048 // filter traversal. | 2046 // filter traversal. |
| 2049 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); | 2047 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); |
| 2050 } | 2048 } |
| 2051 | 2049 |
| 2052 #endif | 2050 #endif |
| OLD | NEW |