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

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

Issue 227433009: Rename kPMColor_SkColorType to kN32_SkColorType. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase 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
« no previous file with comments | « src/image/SkImage_Gpu.cpp ('k') | src/image/SkSurface_Raster.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 "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkImagePriv.h" 10 #include "SkImagePriv.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 SkSurface* SkSurface_Picture::onNewSurface(const SkImageInfo& info) { 55 SkSurface* SkSurface_Picture::onNewSurface(const SkImageInfo& info) {
56 return SkSurface::NewPicture(info.fWidth, info.fHeight); 56 return SkSurface::NewPicture(info.fWidth, info.fHeight);
57 } 57 }
58 58
59 SkImage* SkSurface_Picture::onNewImageSnapshot() { 59 SkImage* SkSurface_Picture::onNewImageSnapshot() {
60 if (fPicture) { 60 if (fPicture) {
61 return SkNewImageFromPicture(fPicture); 61 return SkNewImageFromPicture(fPicture);
62 } else { 62 } else {
63 SkImageInfo info; 63 SkImageInfo info;
64 info.fWidth = info.fHeight = 0; 64 info.fWidth = info.fHeight = 0;
65 info.fColorType = kPMColor_SkColorType; 65 info.fColorType = kN32_SkColorType;
66 info.fAlphaType = kOpaque_SkAlphaType; 66 info.fAlphaType = kOpaque_SkAlphaType;
67 return SkImage::NewRasterCopy(info, NULL, 0); 67 return SkImage::NewRasterCopy(info, NULL, 0);
68 } 68 }
69 } 69 }
70 70
71 void SkSurface_Picture::onDraw(SkCanvas* canvas, SkScalar x, SkScalar y, 71 void SkSurface_Picture::onDraw(SkCanvas* canvas, SkScalar x, SkScalar y,
72 const SkPaint* paint) { 72 const SkPaint* paint) {
73 if (!fPicture) { 73 if (!fPicture) {
74 return; 74 return;
75 } 75 }
(...skipping 17 matching lines...) Expand all
93 /////////////////////////////////////////////////////////////////////////////// 93 ///////////////////////////////////////////////////////////////////////////////
94 94
95 95
96 SkSurface* SkSurface::NewPicture(int width, int height) { 96 SkSurface* SkSurface::NewPicture(int width, int height) {
97 if ((width | height) < 0) { 97 if ((width | height) < 0) {
98 return NULL; 98 return NULL;
99 } 99 }
100 100
101 return SkNEW_ARGS(SkSurface_Picture, (width, height)); 101 return SkNEW_ARGS(SkSurface_Picture, (width, height));
102 } 102 }
OLDNEW
« no previous file with comments | « src/image/SkImage_Gpu.cpp ('k') | src/image/SkSurface_Raster.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698