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

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

Issue 246493002: NewRasterDirect should *not* erase the pixels -- direct means the client is in-charge (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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 /* 2 /*
3 * Copyright 2008 The Android Open Source Project 3 * Copyright 2008 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 2654 matching lines...) Expand 10 before | Expand all | Expand 10 after
2665 2665
2666 SkCanvas* SkCanvas::NewRasterDirect(const SkImageInfo& info, void* pixels, size_ t rowBytes) { 2666 SkCanvas* SkCanvas::NewRasterDirect(const SkImageInfo& info, void* pixels, size_ t rowBytes) {
2667 if (!supported_for_raster_canvas(info)) { 2667 if (!supported_for_raster_canvas(info)) {
2668 return NULL; 2668 return NULL;
2669 } 2669 }
2670 2670
2671 SkBitmap bitmap; 2671 SkBitmap bitmap;
2672 if (!bitmap.installPixels(info, pixels, rowBytes)) { 2672 if (!bitmap.installPixels(info, pixels, rowBytes)) {
2673 return NULL; 2673 return NULL;
2674 } 2674 }
2675
2676 // should this functionality be moved into allocPixels()?
2677 if (!bitmap.info().isOpaque()) {
2678 bitmap.eraseColor(0);
2679 }
2680 return SkNEW_ARGS(SkCanvas, (bitmap)); 2675 return SkNEW_ARGS(SkCanvas, (bitmap));
2681 } 2676 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698