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 "GrCaps.h" | 8 #include "GrCaps.h" |
9 #include "GrContext.h" | 9 #include "GrContext.h" |
10 #include "GrDrawContext.h" | 10 #include "GrDrawContext.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 SkASSERT(tex->height() == h); | 31 SkASSERT(tex->height() == h); |
32 } | 32 } |
33 | 33 |
34 SkImage_Gpu::~SkImage_Gpu() { | 34 SkImage_Gpu::~SkImage_Gpu() { |
35 if (fAddedRasterVersionToCache.load()) { | 35 if (fAddedRasterVersionToCache.load()) { |
36 SkNotifyBitmapGenIDIsStale(this->uniqueID()); | 36 SkNotifyBitmapGenIDIsStale(this->uniqueID()); |
37 } | 37 } |
38 } | 38 } |
39 | 39 |
40 extern void SkTextureImageApplyBudgetedDecision(SkImage* image) { | 40 extern void SkTextureImageApplyBudgetedDecision(SkImage* image) { |
41 if (as_IB(image)->getTexture()) { | 41 if (as_IB(image)->peekTexture()) { |
42 ((SkImage_Gpu*)image)->applyBudgetDecision(); | 42 ((SkImage_Gpu*)image)->applyBudgetDecision(); |
43 } | 43 } |
44 } | 44 } |
45 | 45 |
46 static SkImageInfo make_info(int w, int h, bool isOpaque) { | 46 static SkImageInfo make_info(int w, int h, bool isOpaque) { |
47 return SkImageInfo::MakeN32(w, h, isOpaque ? kOpaque_SkAlphaType : kPremul_S
kAlphaType); | 47 return SkImageInfo::MakeN32(w, h, isOpaque ? kOpaque_SkAlphaType : kPremul_S
kAlphaType); |
48 } | 48 } |
49 | 49 |
50 bool SkImage_Gpu::getROPixels(SkBitmap* dst, CachingHint chint) const { | 50 bool SkImage_Gpu::getROPixels(SkBitmap* dst, CachingHint chint) const { |
51 if (SkBitmapCache::Find(this->uniqueID(), dst)) { | 51 if (SkBitmapCache::Find(this->uniqueID(), dst)) { |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 return nullptr; | 321 return nullptr; |
322 } | 322 } |
323 | 323 |
324 const SkIRect srcR = SkIRect::MakeWH(desc.fWidth, desc.fHeight); | 324 const SkIRect srcR = SkIRect::MakeWH(desc.fWidth, desc.fHeight); |
325 const SkIPoint dstP = SkIPoint::Make(0, 0); | 325 const SkIPoint dstP = SkIPoint::Make(0, 0); |
326 ctx->copySurface(dst, src, srcR, dstP); | 326 ctx->copySurface(dst, src, srcR, dstP); |
327 ctx->flushSurfaceWrites(dst); | 327 ctx->flushSurfaceWrites(dst); |
328 return dst; | 328 return dst; |
329 } | 329 } |
330 | 330 |
OLD | NEW |