OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/debug/trace_event.h" | 5 #include "base/debug/trace_event.h" |
6 #include "base/logging.h" | 6 #include "base/logging.h" |
7 #include "skia/ext/analysis_canvas.h" | 7 #include "skia/ext/analysis_canvas.h" |
8 #include "third_party/skia/include/core/SkDraw.h" | 8 #include "third_party/skia/include/core/SkDraw.h" |
9 #include "third_party/skia/include/core/SkRRect.h" | 9 #include "third_party/skia/include/core/SkRRect.h" |
10 #include "third_party/skia/include/core/SkShader.h" | 10 #include "third_party/skia/include/core/SkShader.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 !paint.getColorFilter() && | 33 !paint.getColorFilter() && |
34 !paint.getImageFilter() && | 34 !paint.getImageFilter() && |
35 paint.getStyle() == SkPaint::kFill_Style && | 35 paint.getStyle() == SkPaint::kFill_Style && |
36 (xfermode == SkXfermode::kSrc_Mode || | 36 (xfermode == SkXfermode::kSrc_Mode || |
37 xfermode == SkXfermode::kSrcOver_Mode)); | 37 xfermode == SkXfermode::kSrcOver_Mode)); |
38 } | 38 } |
39 | 39 |
40 // Returns true if the specified drawn_rect will cover the entire canvas, and | 40 // Returns true if the specified drawn_rect will cover the entire canvas, and |
41 // that the canvas is not clipped (i.e. it covers ALL of the canvas). | 41 // that the canvas is not clipped (i.e. it covers ALL of the canvas). |
42 bool IsFullQuad(SkCanvas* canvas, const SkRect& drawn_rect) { | 42 bool IsFullQuad(SkCanvas* canvas, const SkRect& drawn_rect) { |
43 if (SkCanvas::kRect_ClipType != canvas->getClipType()) | 43 if (!canvas->isClipRect()) |
44 return false; | 44 return false; |
45 | 45 |
46 SkIRect clip_irect; | 46 SkIRect clip_irect; |
47 canvas->getClipDeviceBounds(&clip_irect); | 47 canvas->getClipDeviceBounds(&clip_irect); |
48 // if the clip is smaller than the canvas, we're partly clipped, so abort. | 48 // if the clip is smaller than the canvas, we're partly clipped, so abort. |
49 if (!clip_irect.contains(SkIRect::MakeSize(canvas->getDeviceSize()))) | 49 if (!clip_irect.contains(SkIRect::MakeSize(canvas->getDeviceSize()))) |
50 return false; | 50 return false; |
51 | 51 |
52 const SkMatrix& matrix = canvas->getTotalMatrix(); | 52 const SkMatrix& matrix = canvas->getTotalMatrix(); |
53 // If the transform results in a non-axis aligned | 53 // If the transform results in a non-axis aligned |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 force_not_transparent_stack_level_ = kNoLayer; | 406 force_not_transparent_stack_level_ = kNoLayer; |
407 } | 407 } |
408 } | 408 } |
409 | 409 |
410 INHERITED::willRestore(); | 410 INHERITED::willRestore(); |
411 } | 411 } |
412 | 412 |
413 } // namespace skia | 413 } // namespace skia |
414 | 414 |
415 | 415 |
OLD | NEW |