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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 *color = SK_ColorTRANSPARENT; | 344 *color = SK_ColorTRANSPARENT; |
345 return true; | 345 return true; |
346 } | 346 } |
347 if (is_solid_color_) { | 347 if (is_solid_color_) { |
348 *color = color_; | 348 *color = color_; |
349 return true; | 349 return true; |
350 } | 350 } |
351 return false; | 351 return false; |
352 } | 352 } |
353 | 353 |
354 bool AnalysisCanvas::abortDrawing() { | 354 bool AnalysisCanvas::abort() { |
355 // Early out as soon as we have more than one draw op. | 355 // Early out as soon as we have more than one draw op. |
356 // TODO(vmpstr): Investigate if 1 is the correct metric here. We need to | 356 // TODO(vmpstr): Investigate if 1 is the correct metric here. We need to |
357 // balance the amount of time we spend analyzing vs how many tiles would be | 357 // balance the amount of time we spend analyzing vs how many tiles would be |
358 // solid if the number was higher. | 358 // solid if the number was higher. |
359 if (draw_op_count_ > 1) { | 359 if (draw_op_count_ > 1) { |
360 // We have to reset solid/transparent state to false since we don't | 360 // We have to reset solid/transparent state to false since we don't |
361 // know whether consequent operations will make this false. | 361 // know whether consequent operations will make this false. |
362 is_solid_color_ = false; | 362 is_solid_color_ = false; |
363 is_transparent_ = false; | 363 is_transparent_ = false; |
364 return true; | 364 return true; |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 force_not_transparent_stack_level_ = kNoLayer; | 470 force_not_transparent_stack_level_ = kNoLayer; |
471 } | 471 } |
472 } | 472 } |
473 | 473 |
474 INHERITED::willRestore(); | 474 INHERITED::willRestore(); |
475 } | 475 } |
476 | 476 |
477 } // namespace skia | 477 } // namespace skia |
478 | 478 |
479 | 479 |
OLD | NEW |