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

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

Issue 1240753003: Revert[2] of guard to remove DrawBitmapRectFlags (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 5 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
« no previous file with comments | « src/effects/SkTestImageFilters.cpp ('k') | src/utils/SkNinePatch.cpp » ('j') | 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 #include "SkGr.h" 8 #include "SkGr.h"
9 9
10 #include "GrCaps.h" 10 #include "GrCaps.h"
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 paint.setFilterQuality(kNone_SkFilterQuality); 522 paint.setFilterQuality(kNone_SkFilterQuality);
523 break; 523 break;
524 case Stretch::kBilerp_Type: 524 case Stretch::kBilerp_Type:
525 paint.setFilterQuality(kLow_SkFilterQuality); 525 paint.setFilterQuality(kLow_SkFilterQuality);
526 break; 526 break;
527 case Stretch::kNone_Type: 527 case Stretch::kNone_Type:
528 SkDEBUGFAIL("Shouldn't get here."); 528 SkDEBUGFAIL("Shouldn't get here.");
529 break; 529 break;
530 } 530 }
531 SkRect dstRect = SkRect::MakeWH(SkIntToScalar(stretch.fWidth), SkIntToScalar (stretch.fHeight)); 531 SkRect dstRect = SkRect::MakeWH(SkIntToScalar(stretch.fWidth), SkIntToScalar (stretch.fHeight));
532 canvas.drawBitmapRectToRect(bmp, NULL, dstRect, &paint); 532 canvas.drawBitmapRect(bmp, dstRect, &paint);
533 return stretched; 533 return stretched;
534 } 534 }
535 535
536 static GrTexture* create_bitmap_texture(GrContext* ctx, 536 static GrTexture* create_bitmap_texture(GrContext* ctx,
537 const SkBitmap& bmp, 537 const SkBitmap& bmp,
538 const Stretch& stretch, 538 const Stretch& stretch,
539 const GrUniqueKey& unstretchedKey, 539 const GrUniqueKey& unstretchedKey,
540 const GrUniqueKey& stretchedKey) { 540 const GrUniqueKey& stretchedKey) {
541 if (Stretch::kNone_Type != stretch.fType) { 541 if (Stretch::kNone_Type != stretch.fType) {
542 SkAutoTUnref<GrTexture> unstretched; 542 SkAutoTUnref<GrTexture> unstretched;
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
826 } 826 }
827 return SkImageInfo::Make(w, h, ct, at); 827 return SkImageInfo::Make(w, h, ct, at);
828 } 828 }
829 829
830 830
831 void GrWrapTextureInBitmap(GrTexture* src, int w, int h, bool isOpaque, SkBitmap * dst) { 831 void GrWrapTextureInBitmap(GrTexture* src, int w, int h, bool isOpaque, SkBitmap * dst) {
832 const SkImageInfo info = GrMakeInfoFromTexture(src, w, h, isOpaque); 832 const SkImageInfo info = GrMakeInfoFromTexture(src, w, h, isOpaque);
833 dst->setInfo(info); 833 dst->setInfo(info);
834 dst->setPixelRef(SkNEW_ARGS(SkGrPixelRef, (info, src)))->unref(); 834 dst->setPixelRef(SkNEW_ARGS(SkGrPixelRef, (info, src)))->unref();
835 } 835 }
OLDNEW
« no previous file with comments | « src/effects/SkTestImageFilters.cpp ('k') | src/utils/SkNinePatch.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698