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

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

Issue 638403003: Remove uses of GrAutoScratchTexture. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: comment change Created 6 years, 2 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 /* 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 "GrContext.h" 10 #include "GrContext.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 GrContext* context = this->getContext(); 60 GrContext* context = this->getContext();
61 if (NULL == context) { 61 if (NULL == context) {
62 return false; 62 return false;
63 } 63 }
64 return context->readTexturePixels(this, 64 return context->readTexturePixels(this,
65 left, top, width, height, 65 left, top, width, height,
66 config, buffer, rowBytes, 66 config, buffer, rowBytes,
67 pixelOpsFlags); 67 pixelOpsFlags);
68 } 68 }
69 69
70 void GrTexture::writePixels(int left, int top, int width, int height, 70 bool GrTexture::writePixels(int left, int top, int width, int height,
71 GrPixelConfig config, const void* buffer, 71 GrPixelConfig config, const void* buffer,
72 size_t rowBytes, uint32_t pixelOpsFlags) { 72 size_t rowBytes, uint32_t pixelOpsFlags) {
73 // go through context so that all necessary flushing occurs 73 // go through context so that all necessary flushing occurs
74 GrContext* context = this->getContext(); 74 GrContext* context = this->getContext();
75 if (NULL == context) { 75 if (NULL == context) {
76 return; 76 return false;
77 } 77 }
78 context->writeTexturePixels(this, 78 return context->writeTexturePixels(this,
79 left, top, width, height, 79 left, top, width, height,
80 config, buffer, rowBytes, 80 config, buffer, rowBytes,
81 pixelOpsFlags); 81 pixelOpsFlags);
82 } 82 }
83 83
84 void GrTexture::onRelease() { 84 void GrTexture::onRelease() {
85 SkASSERT(!this->texturePriv().isSetFlag((GrTextureFlags) kReturnToCache_Flag Bit)); 85 SkASSERT(!this->texturePriv().isSetFlag((GrTextureFlags) kReturnToCache_Flag Bit));
86 INHERITED::onRelease(); 86 INHERITED::onRelease();
87 } 87 }
88 88
89 void GrTexture::onAbandon() { 89 void GrTexture::onAbandon() {
90 if (fRenderTarget.get()) { 90 if (fRenderTarget.get()) {
91 fRenderTarget->abandon(); 91 fRenderTarget->abandon();
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 return GrResourceKey(cacheID, ResourceType(), 0); 203 return GrResourceKey(cacheID, ResourceType(), 0);
204 } 204 }
205 205
206 bool GrTexturePriv::NeedsResizing(const GrResourceKey& key) { 206 bool GrTexturePriv::NeedsResizing(const GrResourceKey& key) {
207 return SkToBool(key.getResourceFlags() & kStretchToPOT_TextureFlag); 207 return SkToBool(key.getResourceFlags() & kStretchToPOT_TextureFlag);
208 } 208 }
209 209
210 bool GrTexturePriv::NeedsBilerp(const GrResourceKey& key) { 210 bool GrTexturePriv::NeedsBilerp(const GrResourceKey& key) {
211 return SkToBool(key.getResourceFlags() & kBilerp_TextureFlag); 211 return SkToBool(key.getResourceFlags() & kBilerp_TextureFlag);
212 } 212 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698