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

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

Issue 1410383008: Clarify subrect semantics for GrTextureAdjuster and handle mip maps correctly. (Closed) Base URL: https://skia.googlesource.com/skia.git@producer
Patch Set: Address comment Created 5 years, 1 month 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
« no previous file with comments | « src/gpu/GrTextureParamsAdjuster.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2010 Google Inc. 2 * Copyright 2010 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 8
9 #include "SkGr.h" 9 #include "SkGr.h"
10 10
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 public: 339 public:
340 explicit TextureBitmap_GrTextureAdjuster(const SkBitmap* bmp) 340 explicit TextureBitmap_GrTextureAdjuster(const SkBitmap* bmp)
341 : INHERITED(bmp->getTexture(), SkIRect::MakeWH(bmp->width(), bmp->height ())) 341 : INHERITED(bmp->getTexture(), SkIRect::MakeWH(bmp->width(), bmp->height ()))
342 , fBmp(bmp) {} 342 , fBmp(bmp) {}
343 343
344 private: 344 private:
345 void makeCopyKey(const CopyParams& params, GrUniqueKey* copyKey) override { 345 void makeCopyKey(const CopyParams& params, GrUniqueKey* copyKey) override {
346 if (fBmp->isVolatile()) { 346 if (fBmp->isVolatile()) {
347 return; 347 return;
348 } 348 }
349 // The texture subset must represent the whole bitmap. Texture-backed bi tmaps don't support 349 // The content area must represent the whole bitmap. Texture-backed bitm aps don't support
350 // extractSubset(). Therefore, either the bitmap and the teture are the same size or the 350 // extractSubset(). Therefore, either the bitmap and the texture are the same size or the
351 // subset's dimensions are the bitmap's dimensions. 351 // content's dimensions are the bitmap's dimensions which is pinned to t he upper left
352 // of the texture.
352 GrUniqueKey baseKey; 353 GrUniqueKey baseKey;
353 GrMakeKeyFromImageID(&baseKey, fBmp->getGenerationID(), 354 GrMakeKeyFromImageID(&baseKey, fBmp->getGenerationID(),
354 SkIRect::MakeWH(fBmp->width(), fBmp->height())); 355 SkIRect::MakeWH(fBmp->width(), fBmp->height()));
355 MakeCopyKeyFromOrigKey(baseKey, params, copyKey); 356 MakeCopyKeyFromOrigKey(baseKey, params, copyKey);
356 } 357 }
357 358
358 void didCacheCopy(const GrUniqueKey& copyKey) override { 359 void didCacheCopy(const GrUniqueKey& copyKey) override {
359 install_bmp_key_invalidator(copyKey, fBmp->pixelRef()); 360 install_bmp_key_invalidator(copyKey, fBmp->pixelRef());
360 } 361 }
361 362
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
683 SkErrorInternals::SetError( kInvalidPaint_SkError, 684 SkErrorInternals::SetError( kInvalidPaint_SkError,
684 "Sorry, I don't understand the filtering " 685 "Sorry, I don't understand the filtering "
685 "mode you asked for. Falling back to " 686 "mode you asked for. Falling back to "
686 "MIPMaps."); 687 "MIPMaps.");
687 textureFilterMode = GrTextureParams::kMipMap_FilterMode; 688 textureFilterMode = GrTextureParams::kMipMap_FilterMode;
688 break; 689 break;
689 690
690 } 691 }
691 return textureFilterMode; 692 return textureFilterMode;
692 } 693 }
OLDNEW
« no previous file with comments | « src/gpu/GrTextureParamsAdjuster.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698