blob: 7c5f87f1d4622c3b27a063b46e8cf128b340c79e [file] [log] [blame]
bsalomon@google.com669fdc42011-04-05 17:08:27 +00001/*
2 Copyright 2011 Google Inc.
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15 */
16
17#include "GrTexture.h"
18#include "GrContext.h"
19
20bool GrRenderTarget::readPixels(int left, int top, int width, int height,
21 GrPixelConfig config, void* buffer) {
22 // go through context so that all necessary flushing occurs
23 GrContext* context = this->getGpu()->getContext();
24 GrAssert(NULL != context);
25 return context->readRenderTargetPixels(this,
26 left, top,
27 width, height,
28 config, buffer);
29}
30
31GrTexture::~GrTexture() {
32 // use this to set a break-point if needed
33// Gr_clz(3);
34}
35
36bool GrTexture::readPixels(int left, int top, int width, int height,
37 GrPixelConfig config, void* buffer) {
38 // go through context so that all necessary flushing occurs
39 GrContext* context = this->getGpu()->getContext();
40 GrAssert(NULL != context);
41 return context->readTexturePixels(this,
42 left, top,
43 width, height,
44 config, buffer);
45}