OLD | NEW |
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 "GrSurfacePriv.h" | 9 #include "GrSurfacePriv.h" |
10 | 10 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 } | 89 } |
90 | 90 |
91 | 91 |
92 ////////////////////////////////////////////////////////////////////////////// | 92 ////////////////////////////////////////////////////////////////////////////// |
93 | 93 |
94 bool GrSurface::writePixels(int left, int top, int width, int height, | 94 bool GrSurface::writePixels(int left, int top, int width, int height, |
95 GrPixelConfig config, const void* buffer, size_t row
Bytes, | 95 GrPixelConfig config, const void* buffer, size_t row
Bytes, |
96 uint32_t pixelOpsFlags) { | 96 uint32_t pixelOpsFlags) { |
97 // go through context so that all necessary flushing occurs | 97 // go through context so that all necessary flushing occurs |
98 GrContext* context = this->getContext(); | 98 GrContext* context = this->getContext(); |
99 if (NULL == context) { | 99 if (nullptr == context) { |
100 return false; | 100 return false; |
101 } | 101 } |
102 return context->writeSurfacePixels(this, left, top, width, height, config, b
uffer, rowBytes, | 102 return context->writeSurfacePixels(this, left, top, width, height, config, b
uffer, rowBytes, |
103 pixelOpsFlags); | 103 pixelOpsFlags); |
104 } | 104 } |
105 | 105 |
106 bool GrSurface::readPixels(int left, int top, int width, int height, | 106 bool GrSurface::readPixels(int left, int top, int width, int height, |
107 GrPixelConfig config, void* buffer, size_t rowBytes, | 107 GrPixelConfig config, void* buffer, size_t rowBytes, |
108 uint32_t pixelOpsFlags) { | 108 uint32_t pixelOpsFlags) { |
109 // go through context so that all necessary flushing occurs | 109 // go through context so that all necessary flushing occurs |
110 GrContext* context = this->getContext(); | 110 GrContext* context = this->getContext(); |
111 if (NULL == context) { | 111 if (nullptr == context) { |
112 return false; | 112 return false; |
113 } | 113 } |
114 return context->readSurfacePixels(this, left, top, width, height, config, bu
ffer, | 114 return context->readSurfacePixels(this, left, top, width, height, config, bu
ffer, |
115 rowBytes, pixelOpsFlags); | 115 rowBytes, pixelOpsFlags); |
116 } | 116 } |
117 | 117 |
118 SkImageInfo GrSurface::info(SkAlphaType alphaType) const { | 118 SkImageInfo GrSurface::info(SkAlphaType alphaType) const { |
119 SkColorType colorType; | 119 SkColorType colorType; |
120 SkColorProfileType profileType; | 120 SkColorProfileType profileType; |
121 if (!GrPixelConfig2ColorAndProfileType(this->config(), &colorType, &profileT
ype)) { | 121 if (!GrPixelConfig2ColorAndProfileType(this->config(), &colorType, &profileT
ype)) { |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 | 202 |
203 void GrSurface::onRelease() { | 203 void GrSurface::onRelease() { |
204 this->invokeReleaseProc(); | 204 this->invokeReleaseProc(); |
205 this->INHERITED::onRelease(); | 205 this->INHERITED::onRelease(); |
206 } | 206 } |
207 | 207 |
208 void GrSurface::onAbandon() { | 208 void GrSurface::onAbandon() { |
209 this->invokeReleaseProc(); | 209 this->invokeReleaseProc(); |
210 this->INHERITED::onAbandon(); | 210 this->INHERITED::onAbandon(); |
211 } | 211 } |
OLD | NEW |