| 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/logging.h" | 5 #include "base/logging.h" |
| 6 #include "base/trace_event/trace_event.h" | 6 #include "base/trace_event/trace_event.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 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 *color = SK_ColorTRANSPARENT; | 318 *color = SK_ColorTRANSPARENT; |
| 319 return true; | 319 return true; |
| 320 } | 320 } |
| 321 if (is_solid_color_) { | 321 if (is_solid_color_) { |
| 322 *color = color_; | 322 *color = color_; |
| 323 return true; | 323 return true; |
| 324 } | 324 } |
| 325 return false; | 325 return false; |
| 326 } | 326 } |
| 327 | 327 |
| 328 bool AnalysisCanvas::abortDrawing() { | 328 bool AnalysisCanvas::abort() { |
| 329 // Early out as soon as we have more than one draw op. | 329 // Early out as soon as we have more than one draw op. |
| 330 // TODO(vmpstr): Investigate if 1 is the correct metric here. We need to | 330 // TODO(vmpstr): Investigate if 1 is the correct metric here. We need to |
| 331 // balance the amount of time we spend analyzing vs how many tiles would be | 331 // balance the amount of time we spend analyzing vs how many tiles would be |
| 332 // solid if the number was higher. | 332 // solid if the number was higher. |
| 333 if (draw_op_count_ > 1) { | 333 if (draw_op_count_ > 1) { |
| 334 // We have to reset solid/transparent state to false since we don't | 334 // We have to reset solid/transparent state to false since we don't |
| 335 // know whether consequent operations will make this false. | 335 // know whether consequent operations will make this false. |
| 336 is_solid_color_ = false; | 336 is_solid_color_ = false; |
| 337 is_transparent_ = false; | 337 is_transparent_ = false; |
| 338 return true; | 338 return true; |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 force_not_transparent_stack_level_ = kNoLayer; | 444 force_not_transparent_stack_level_ = kNoLayer; |
| 445 } | 445 } |
| 446 } | 446 } |
| 447 | 447 |
| 448 INHERITED::willRestore(); | 448 INHERITED::willRestore(); |
| 449 } | 449 } |
| 450 | 450 |
| 451 } // namespace skia | 451 } // namespace skia |
| 452 | 452 |
| 453 | 453 |
| OLD | NEW |