Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(170)

Side by Side Diff: src/core/SkBitmapDevice.cpp

Issue 551463004: introduce Props to surface (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add new file Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/utils/SkNoSaveLayerCanvas.h ('k') | src/core/SkCanvas.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 draw.drawVertices(vmode, vertexCount, verts, textures, colors, xmode, 350 draw.drawVertices(vmode, vertexCount, verts, textures, colors, xmode,
351 indices, indexCount, paint); 351 indices, indexCount, paint);
352 } 352 }
353 353
354 void SkBitmapDevice::drawDevice(const SkDraw& draw, SkBaseDevice* device, 354 void SkBitmapDevice::drawDevice(const SkDraw& draw, SkBaseDevice* device,
355 int x, int y, const SkPaint& paint) { 355 int x, int y, const SkPaint& paint) {
356 const SkBitmap& src = device->accessBitmap(false); 356 const SkBitmap& src = device->accessBitmap(false);
357 draw.drawSprite(src, x, y, paint); 357 draw.drawSprite(src, x, y, paint);
358 } 358 }
359 359
360 SkSurface* SkBitmapDevice::newSurface(const SkImageInfo& info) { 360 SkSurface* SkBitmapDevice::newSurface(const SkImageInfo& info, const SkSurfacePr ops& props) {
361 return SkSurface::NewRaster(info); 361 return SkSurface::NewRaster(info, &props);
362 } 362 }
363 363
364 const void* SkBitmapDevice::peekPixels(SkImageInfo* info, size_t* rowBytes) { 364 const void* SkBitmapDevice::peekPixels(SkImageInfo* info, size_t* rowBytes) {
365 const SkImageInfo bmInfo = fBitmap.info(); 365 const SkImageInfo bmInfo = fBitmap.info();
366 if (fBitmap.getPixels() && (kUnknown_SkColorType != bmInfo.colorType())) { 366 if (fBitmap.getPixels() && (kUnknown_SkColorType != bmInfo.colorType())) {
367 if (info) { 367 if (info) {
368 *info = bmInfo; 368 *info = bmInfo;
369 } 369 }
370 if (rowBytes) { 370 if (rowBytes) {
371 *rowBytes = fBitmap.rowBytes(); 371 *rowBytes = fBitmap.rowBytes();
(...skipping 24 matching lines...) Expand all
396 paint.getStyle() != SkPaint::kFill_Style || 396 paint.getStyle() != SkPaint::kFill_Style ||
397 !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode)) { 397 !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode)) {
398 // turn off lcd, but turn on kGenA8 398 // turn off lcd, but turn on kGenA8
399 flags->fFlags = paint.getFlags() & ~SkPaint::kLCDRenderText_Flag; 399 flags->fFlags = paint.getFlags() & ~SkPaint::kLCDRenderText_Flag;
400 flags->fFlags |= SkPaint::kGenA8FromLCD_Flag; 400 flags->fFlags |= SkPaint::kGenA8FromLCD_Flag;
401 return true; 401 return true;
402 } 402 }
403 // we're cool with the paint as is 403 // we're cool with the paint as is
404 return false; 404 return false;
405 } 405 }
OLDNEW
« no previous file with comments | « include/utils/SkNoSaveLayerCanvas.h ('k') | src/core/SkCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698