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

Side by Side Diff: src/gpu/GrSurface.cpp

Issue 2071393002: More removal of SkColorProfileType... (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Restore API used in Chrome Created 4 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/gpu/GrContext.cpp ('k') | src/gpu/SkGr.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 "GrSurface.h" 8 #include "GrSurface.h"
9 #include "GrContext.h" 9 #include "GrContext.h"
10 #include "GrSurfacePriv.h" 10 #include "GrSurfacePriv.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 GrContext* context = this->getContext(); 111 GrContext* context = this->getContext();
112 if (nullptr == context) { 112 if (nullptr == context) {
113 return false; 113 return false;
114 } 114 }
115 return context->readSurfacePixels(this, left, top, width, height, config, bu ffer, 115 return context->readSurfacePixels(this, left, top, width, height, config, bu ffer,
116 rowBytes, pixelOpsFlags); 116 rowBytes, pixelOpsFlags);
117 } 117 }
118 118
119 SkImageInfo GrSurface::info(SkAlphaType alphaType) const { 119 SkImageInfo GrSurface::info(SkAlphaType alphaType) const {
120 SkColorType colorType; 120 SkColorType colorType;
121 SkColorProfileType profileType; 121 sk_sp<SkColorSpace> colorSpace;
122 if (!GrPixelConfig2ColorAndProfileType(this->config(), &colorType, &profileT ype)) { 122 if (!GrPixelConfigToColorAndColorSpace(this->config(), &colorType, &colorSpa ce)) {
123 sk_throw(); 123 sk_throw();
124 } 124 }
125 return SkImageInfo::Make(this->width(), this->height(), colorType, alphaType , 125 return SkImageInfo::Make(this->width(), this->height(), colorType, alphaType , colorSpace);
126 profileType);
127 } 126 }
128 127
129 // TODO: This should probably be a non-member helper function. It might only be needed in 128 // TODO: This should probably be a non-member helper function. It might only be needed in
130 // debug or developer builds. 129 // debug or developer builds.
131 bool GrSurface::savePixels(const char* filename) { 130 bool GrSurface::savePixels(const char* filename) {
132 SkBitmap bm; 131 SkBitmap bm;
133 if (!bm.tryAllocPixels(SkImageInfo::MakeN32Premul(this->width(), this->heigh t()))) { 132 if (!bm.tryAllocPixels(SkImageInfo::MakeN32Premul(this->width(), this->heigh t()))) {
134 return false; 133 return false;
135 } 134 }
136 135
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 202
204 void GrSurface::onRelease() { 203 void GrSurface::onRelease() {
205 this->invokeReleaseProc(); 204 this->invokeReleaseProc();
206 this->INHERITED::onRelease(); 205 this->INHERITED::onRelease();
207 } 206 }
208 207
209 void GrSurface::onAbandon() { 208 void GrSurface::onAbandon() {
210 this->invokeReleaseProc(); 209 this->invokeReleaseProc();
211 this->INHERITED::onAbandon(); 210 this->INHERITED::onAbandon();
212 } 211 }
OLDNEW
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | src/gpu/SkGr.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698