OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "SkBitmapDevice.h" | 8 #include "SkBitmapDevice.h" |
9 #include "SkConfig8888.h" | 9 #include "SkConfig8888.h" |
10 #include "SkDraw.h" | 10 #include "SkDraw.h" |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 const SkPaint& paint) { | 353 const SkPaint& paint) { |
354 draw.drawVertices(vmode, vertexCount, verts, textures, colors, xmode, | 354 draw.drawVertices(vmode, vertexCount, verts, textures, colors, xmode, |
355 indices, indexCount, paint); | 355 indices, indexCount, paint); |
356 } | 356 } |
357 | 357 |
358 void SkBitmapDevice::drawDevice(const SkDraw& draw, SkBaseDevice* device, | 358 void SkBitmapDevice::drawDevice(const SkDraw& draw, SkBaseDevice* device, |
359 int x, int y, const SkPaint& paint) { | 359 int x, int y, const SkPaint& paint) { |
360 draw.drawSprite(static_cast<SkBitmapDevice*>(device)->fBitmap, x, y, paint); | 360 draw.drawSprite(static_cast<SkBitmapDevice*>(device)->fBitmap, x, y, paint); |
361 } | 361 } |
362 | 362 |
363 SkSurface* SkBitmapDevice::newSurface(const SkImageInfo& info, const SkSurfacePr
ops& props) { | 363 sk_sp<SkSurface> SkBitmapDevice::makeSurface(const SkImageInfo& info, const SkSu
rfaceProps& props) { |
364 return SkSurface::NewRaster(info, &props); | 364 return SkSurface::MakeRaster(info, &props); |
365 } | 365 } |
366 | 366 |
367 SkImageFilter::Cache* SkBitmapDevice::getImageFilterCache() { | 367 SkImageFilter::Cache* SkBitmapDevice::getImageFilterCache() { |
368 SkImageFilter::Cache* cache = SkImageFilter::Cache::Get(); | 368 SkImageFilter::Cache* cache = SkImageFilter::Cache::Get(); |
369 cache->ref(); | 369 cache->ref(); |
370 return cache; | 370 return cache; |
371 } | 371 } |
372 | 372 |
373 /////////////////////////////////////////////////////////////////////////////// | 373 /////////////////////////////////////////////////////////////////////////////// |
374 | 374 |
375 bool SkBitmapDevice::onShouldDisableLCD(const SkPaint& paint) const { | 375 bool SkBitmapDevice::onShouldDisableLCD(const SkPaint& paint) const { |
376 if (kN32_SkColorType != fBitmap.colorType() || | 376 if (kN32_SkColorType != fBitmap.colorType() || |
377 paint.getRasterizer() || | 377 paint.getRasterizer() || |
378 paint.getPathEffect() || | 378 paint.getPathEffect() || |
379 paint.isFakeBoldText() || | 379 paint.isFakeBoldText() || |
380 paint.getStyle() != SkPaint::kFill_Style || | 380 paint.getStyle() != SkPaint::kFill_Style || |
381 !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode)) | 381 !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode)) |
382 { | 382 { |
383 return true; | 383 return true; |
384 } | 384 } |
385 return false; | 385 return false; |
386 } | 386 } |
OLD | NEW |