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

Side by Side Diff: src/core/SkCanvas.cpp

Issue 2388873002: remove quickreject for drawables (Closed)
Patch Set: Created 4 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
« no previous file with comments | « no previous file | 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 2008 The Android Open Source Project 2 * Copyright 2008 The Android Open Source Project
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 "SkBitmapDevice.h" 8 #include "SkBitmapDevice.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkCanvasPriv.h" 10 #include "SkCanvasPriv.h"
(...skipping 2936 matching lines...) Expand 10 before | Expand all | Expand 10 after
2947 2947
2948 void SkCanvas::drawDrawable(SkDrawable* dr, const SkMatrix* matrix) { 2948 void SkCanvas::drawDrawable(SkDrawable* dr, const SkMatrix* matrix) {
2949 RETURN_ON_NULL(dr); 2949 RETURN_ON_NULL(dr);
2950 if (matrix && matrix->isIdentity()) { 2950 if (matrix && matrix->isIdentity()) {
2951 matrix = nullptr; 2951 matrix = nullptr;
2952 } 2952 }
2953 this->onDrawDrawable(dr, matrix); 2953 this->onDrawDrawable(dr, matrix);
2954 } 2954 }
2955 2955
2956 void SkCanvas::onDrawDrawable(SkDrawable* dr, const SkMatrix* matrix) { 2956 void SkCanvas::onDrawDrawable(SkDrawable* dr, const SkMatrix* matrix) {
2957 SkRect bounds = dr->getBounds(); 2957 // drawable bounds are no longer reliable (e.g. android displaylist)
2958 if (matrix) { 2958 // so don't use them for quick-reject
2959 matrix->mapRect(&bounds);
2960 }
2961 if (this->quickReject(bounds)) {
2962 return;
2963 }
2964 dr->draw(this, matrix); 2959 dr->draw(this, matrix);
2965 } 2960 }
2966 2961
2967 void SkCanvas::onDrawAtlas(const SkImage* atlas, const SkRSXform xform[], const SkRect tex[], 2962 void SkCanvas::onDrawAtlas(const SkImage* atlas, const SkRSXform xform[], const SkRect tex[],
2968 const SkColor colors[], int count, SkXfermode::Mode m ode, 2963 const SkColor colors[], int count, SkXfermode::Mode m ode,
2969 const SkRect* cull, const SkPaint* paint) { 2964 const SkRect* cull, const SkPaint* paint) {
2970 if (cull && this->quickReject(*cull)) { 2965 if (cull && this->quickReject(*cull)) {
2971 return; 2966 return;
2972 } 2967 }
2973 2968
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
3461 const SkCanvas::ClipOp SkCanvas::kXOR_Op; 3456 const SkCanvas::ClipOp SkCanvas::kXOR_Op;
3462 const SkCanvas::ClipOp SkCanvas::kReverseDifference_Op; 3457 const SkCanvas::ClipOp SkCanvas::kReverseDifference_Op;
3463 const SkCanvas::ClipOp SkCanvas::kReplace_Op; 3458 const SkCanvas::ClipOp SkCanvas::kReplace_Op;
3464 3459
3465 static_assert((int)SkRegion::kDifference_Op == (int)kDifference_SkClipOp , ""); 3460 static_assert((int)SkRegion::kDifference_Op == (int)kDifference_SkClipOp , "");
3466 static_assert((int)SkRegion::kIntersect_Op == (int)kIntersect_SkClipOp, ""); 3461 static_assert((int)SkRegion::kIntersect_Op == (int)kIntersect_SkClipOp, "");
3467 static_assert((int)SkRegion::kUnion_Op == (int)kUnion_SkClipOp, "") ; 3462 static_assert((int)SkRegion::kUnion_Op == (int)kUnion_SkClipOp, "") ;
3468 static_assert((int)SkRegion::kXOR_Op == (int)kXOR_SkClipOp, ""); 3463 static_assert((int)SkRegion::kXOR_Op == (int)kXOR_SkClipOp, "");
3469 static_assert((int)SkRegion::kReverseDifference_Op == (int)kReverseDifference_S kClipOp, ""); 3464 static_assert((int)SkRegion::kReverseDifference_Op == (int)kReverseDifference_S kClipOp, "");
3470 static_assert((int)SkRegion::kReplace_Op == (int)kReplace_SkClipOp, " "); 3465 static_assert((int)SkRegion::kReplace_Op == (int)kReplace_SkClipOp, " ");
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698