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

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

Issue 1919993002: Added --deepColor option to SampleApp, triggers creation of a ten-bit/channel buffer on Windows. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Plumb gamma to shader, fix window title Created 4 years, 7 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
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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 uint32_t pixelOpsFlags) { 109 uint32_t pixelOpsFlags) {
110 // go through context so that all necessary flushing occurs 110 // go through context so that all necessary flushing occurs
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 bool GrSurface::writePixelsWithColorSpace(int left, int top, int width, int heig ht,
120 GrPixelConfig config,
121 const SkColorSpace* srcColorSpace,
122 const SkColorSpace* dstColorSpace,
123 const void* buffer, size_t rowBytes,
124 uint32_t colorSpaceOpsFlags) {
125 // go through context so that all necessary flushing occurs
126 GrContext* context = this->getContext();
127 if (nullptr == context) {
128 return false;
129 }
130 return context->writeSurfacePixelsWithColorSpace(this, left, top, width, hei ght, config,
131 srcColorSpace, dstColorSpac e, buffer,
132 rowBytes, colorSpaceOpsFlag s);
133 }
134
119 SkImageInfo GrSurface::info(SkAlphaType alphaType) const { 135 SkImageInfo GrSurface::info(SkAlphaType alphaType) const {
120 SkColorType colorType; 136 SkColorType colorType;
121 SkColorProfileType profileType; 137 SkColorProfileType profileType;
122 if (!GrPixelConfig2ColorAndProfileType(this->config(), &colorType, &profileT ype)) { 138 if (!GrPixelConfig2ColorAndProfileType(this->config(), &colorType, &profileT ype)) {
123 sk_throw(); 139 sk_throw();
124 } 140 }
125 return SkImageInfo::Make(this->width(), this->height(), colorType, alphaType , 141 return SkImageInfo::Make(this->width(), this->height(), colorType, alphaType ,
126 profileType); 142 profileType);
127 } 143 }
128 144
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 219
204 void GrSurface::onRelease() { 220 void GrSurface::onRelease() {
205 this->invokeReleaseProc(); 221 this->invokeReleaseProc();
206 this->INHERITED::onRelease(); 222 this->INHERITED::onRelease();
207 } 223 }
208 224
209 void GrSurface::onAbandon() { 225 void GrSurface::onAbandon() {
210 this->invokeReleaseProc(); 226 this->invokeReleaseProc();
211 this->INHERITED::onAbandon(); 227 this->INHERITED::onAbandon();
212 } 228 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698