OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #include "GrRenderTarget.h" | 10 #include "GrRenderTarget.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 GrContext* context = this->getContext(); | 22 GrContext* context = this->getContext(); |
23 if (NULL == context) { | 23 if (NULL == context) { |
24 return false; | 24 return false; |
25 } | 25 } |
26 return context->readRenderTargetPixels(this, | 26 return context->readRenderTargetPixels(this, |
27 left, top, width, height, | 27 left, top, width, height, |
28 config, buffer, rowBytes, | 28 config, buffer, rowBytes, |
29 pixelOpsFlags); | 29 pixelOpsFlags); |
30 } | 30 } |
31 | 31 |
32 void GrRenderTarget::writePixels(int left, int top, int width, int height, | 32 bool GrRenderTarget::writePixels(int left, int top, int width, int height, |
33 GrPixelConfig config, | 33 GrPixelConfig config, |
34 const void* buffer, | 34 const void* buffer, |
35 size_t rowBytes, | 35 size_t rowBytes, |
36 uint32_t pixelOpsFlags) { | 36 uint32_t pixelOpsFlags) { |
37 // go through context so that all necessary flushing occurs | 37 // go through context so that all necessary flushing occurs |
38 GrContext* context = this->getContext(); | 38 GrContext* context = this->getContext(); |
39 if (NULL == context) { | 39 if (NULL == context) { |
40 return; | 40 return false; |
41 } | 41 } |
42 context->writeRenderTargetPixels(this, | 42 return context->writeRenderTargetPixels(this, |
43 left, top, width, height, | 43 left, top, width, height, |
44 config, buffer, rowBytes, | 44 config, buffer, rowBytes, |
45 pixelOpsFlags); | 45 pixelOpsFlags); |
46 } | 46 } |
47 | 47 |
48 void GrRenderTarget::resolve() { | 48 void GrRenderTarget::resolve() { |
49 // go through context so that all necessary flushing occurs | 49 // go through context so that all necessary flushing occurs |
50 GrContext* context = this->getContext(); | 50 GrContext* context = this->getContext(); |
51 if (NULL == context) { | 51 if (NULL == context) { |
52 return; | 52 return; |
53 } | 53 } |
54 context->resolveRenderTarget(this); | 54 context->resolveRenderTarget(this); |
55 } | 55 } |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 this->setStencilBuffer(NULL); | 109 this->setStencilBuffer(NULL); |
110 | 110 |
111 INHERITED::onRelease(); | 111 INHERITED::onRelease(); |
112 } | 112 } |
113 | 113 |
114 void GrRenderTarget::onAbandon() { | 114 void GrRenderTarget::onAbandon() { |
115 this->setStencilBuffer(NULL); | 115 this->setStencilBuffer(NULL); |
116 | 116 |
117 INHERITED::onAbandon(); | 117 INHERITED::onAbandon(); |
118 } | 118 } |
OLD | NEW |