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

Side by Side Diff: src/image/SkSurface_Raster.cpp

Issue 1195003003: Propagate SkSurfaceProps to more call sites (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 6 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 | « src/c/sk_surface.cpp ('k') | src/utils/SkLua.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 2012 Google Inc. 2 * Copyright 2012 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 "SkSurface_Base.h" 8 #include "SkSurface_Base.h"
9 #include "SkImagePriv.h" 9 #include "SkImagePriv.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 if (!info.isOpaque()) { 102 if (!info.isOpaque()) {
103 fBitmap.eraseColor(SK_ColorTRANSPARENT); 103 fBitmap.eraseColor(SK_ColorTRANSPARENT);
104 } 104 }
105 } 105 }
106 106
107 SkCanvas* SkSurface_Raster::onNewCanvas() { 107 SkCanvas* SkSurface_Raster::onNewCanvas() {
108 return SkNEW_ARGS(SkCanvas, (fBitmap, this->props())); 108 return SkNEW_ARGS(SkCanvas, (fBitmap, this->props()));
109 } 109 }
110 110
111 SkSurface* SkSurface_Raster::onNewSurface(const SkImageInfo& info) { 111 SkSurface* SkSurface_Raster::onNewSurface(const SkImageInfo& info) {
112 return SkSurface::NewRaster(info); 112 return SkSurface::NewRaster(info, &this->props());
113 } 113 }
114 114
115 void SkSurface_Raster::onDraw(SkCanvas* canvas, SkScalar x, SkScalar y, 115 void SkSurface_Raster::onDraw(SkCanvas* canvas, SkScalar x, SkScalar y,
116 const SkPaint* paint) { 116 const SkPaint* paint) {
117 canvas->drawBitmap(fBitmap, x, y, paint); 117 canvas->drawBitmap(fBitmap, x, y, paint);
118 } 118 }
119 119
120 SkImage* SkSurface_Raster::onNewImageSnapshot(Budgeted) { 120 SkImage* SkSurface_Raster::onNewImageSnapshot(Budgeted) {
121 return SkNewImageFromBitmap(fBitmap, fWeOwnThePixels, &this->props()); 121 return SkNewImageFromBitmap(fBitmap, fWeOwnThePixels, &this->props());
122 } 122 }
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 if (!SkSurface_Raster::Valid(info)) { 168 if (!SkSurface_Raster::Valid(info)) {
169 return NULL; 169 return NULL;
170 } 170 }
171 171
172 SkAutoTUnref<SkPixelRef> pr(SkMallocPixelRef::NewAllocate(info, 0, NULL)); 172 SkAutoTUnref<SkPixelRef> pr(SkMallocPixelRef::NewAllocate(info, 0, NULL));
173 if (NULL == pr.get()) { 173 if (NULL == pr.get()) {
174 return NULL; 174 return NULL;
175 } 175 }
176 return SkNEW_ARGS(SkSurface_Raster, (pr, props)); 176 return SkNEW_ARGS(SkSurface_Raster, (pr, props));
177 } 177 }
OLDNEW
« no previous file with comments | « src/c/sk_surface.cpp ('k') | src/utils/SkLua.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698