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

Side by Side Diff: skia/ext/analysis_canvas.cc

Issue 1138923005: Remove SK_LEGACY_DRAWPICTURECALLBACK (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: analysis_canvas_unittest fix Created 5 years, 7 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 | « skia/ext/analysis_canvas.h ('k') | skia/ext/analysis_canvas_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « skia/ext/analysis_canvas.h ('k') | skia/ext/analysis_canvas_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698