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" |
11 | 11 |
12 #include "GrContext.h" | 12 #include "GrContext.h" |
13 #include "GrGpu.h" | 13 #include "GrGpu.h" |
14 #include "GrStencilBuffer.h" | 14 #include "GrStencilBuffer.h" |
15 | 15 |
16 bool GrRenderTarget::readPixels(int left, int top, int width, int height, | |
17 GrPixelConfig config, | |
18 void* buffer, | |
19 size_t rowBytes, | |
20 uint32_t pixelOpsFlags) { | |
21 // go through context so that all necessary flushing occurs | |
22 GrContext* context = this->getContext(); | |
23 if (NULL == context) { | |
24 return false; | |
25 } | |
26 return context->readRenderTargetPixels(this, | |
27 left, top, width, height, | |
28 config, buffer, rowBytes, | |
29 pixelOpsFlags); | |
30 } | |
31 | |
32 void GrRenderTarget::writePixels(int left, int top, int width, int height, | |
33 GrPixelConfig config, | |
34 const void* buffer, | |
35 size_t rowBytes, | |
36 uint32_t pixelOpsFlags) { | |
37 // go through context so that all necessary flushing occurs | |
38 GrContext* context = this->getContext(); | |
39 if (NULL == context) { | |
40 return; | |
41 } | |
42 context->writeRenderTargetPixels(this, | |
43 left, top, width, height, | |
44 config, buffer, rowBytes, | |
45 pixelOpsFlags); | |
46 } | |
47 | |
48 void GrRenderTarget::resolve() { | 16 void GrRenderTarget::resolve() { |
49 // go through context so that all necessary flushing occurs | 17 // go through context so that all necessary flushing occurs |
50 GrContext* context = this->getContext(); | 18 GrContext* context = this->getContext(); |
51 if (NULL == context) { | 19 if (NULL == context) { |
52 return; | 20 return; |
53 } | 21 } |
54 context->resolveRenderTarget(this); | 22 context->resolveRenderTarget(this); |
55 } | 23 } |
56 | 24 |
57 void GrRenderTarget::discard() { | 25 void GrRenderTarget::discard() { |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 this->setStencilBuffer(NULL); | 77 this->setStencilBuffer(NULL); |
110 | 78 |
111 INHERITED::onRelease(); | 79 INHERITED::onRelease(); |
112 } | 80 } |
113 | 81 |
114 void GrRenderTarget::onAbandon() { | 82 void GrRenderTarget::onAbandon() { |
115 this->setStencilBuffer(NULL); | 83 this->setStencilBuffer(NULL); |
116 | 84 |
117 INHERITED::onAbandon(); | 85 INHERITED::onAbandon(); |
118 } | 86 } |
OLD | NEW |