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

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

Issue 536003002: Hide fields in SkImageInfo (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix qt 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 | « src/image/SkImage_Raster.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 "SkImagePriv.h" 9 #include "SkImagePriv.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 } 73 }
74 74
75 /////////////////////////////////////////////////////////////////////////////// 75 ///////////////////////////////////////////////////////////////////////////////
76 76
77 SkSurface::SkSurface(int width, int height) : fWidth(width), fHeight(height) { 77 SkSurface::SkSurface(int width, int height) : fWidth(width), fHeight(height) {
78 SkASSERT(fWidth >= 0); 78 SkASSERT(fWidth >= 0);
79 SkASSERT(fHeight >= 0); 79 SkASSERT(fHeight >= 0);
80 fGenerationID = 0; 80 fGenerationID = 0;
81 } 81 }
82 82
83 SkSurface::SkSurface(const SkImageInfo& info) 83 SkSurface::SkSurface(const SkImageInfo& info) : fWidth(info.width()), fHeight(in fo.height()) {
84 : fWidth(info.fWidth)
85 , fHeight(info.fHeight)
86 {
87 SkASSERT(fWidth >= 0); 84 SkASSERT(fWidth >= 0);
88 SkASSERT(fHeight >= 0); 85 SkASSERT(fHeight >= 0);
89 fGenerationID = 0; 86 fGenerationID = 0;
90 } 87 }
91 88
92 uint32_t SkSurface::generationID() { 89 uint32_t SkSurface::generationID() {
93 if (0 == fGenerationID) { 90 if (0 == fGenerationID) {
94 fGenerationID = asSB(this)->newGenerationID(); 91 fGenerationID = asSB(this)->newGenerationID();
95 } 92 }
96 return fGenerationID; 93 return fGenerationID;
(...skipping 18 matching lines...) Expand all
115 } 112 }
116 113
117 void SkSurface::draw(SkCanvas* canvas, SkScalar x, SkScalar y, 114 void SkSurface::draw(SkCanvas* canvas, SkScalar x, SkScalar y,
118 const SkPaint* paint) { 115 const SkPaint* paint) {
119 return asSB(this)->onDraw(canvas, x, y, paint); 116 return asSB(this)->onDraw(canvas, x, y, paint);
120 } 117 }
121 118
122 const void* SkSurface::peekPixels(SkImageInfo* info, size_t* rowBytes) { 119 const void* SkSurface::peekPixels(SkImageInfo* info, size_t* rowBytes) {
123 return this->getCanvas()->peekPixels(info, rowBytes); 120 return this->getCanvas()->peekPixels(info, rowBytes);
124 } 121 }
OLDNEW
« no previous file with comments | « src/image/SkImage_Raster.cpp ('k') | src/image/SkSurface_Raster.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698