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

Side by Side Diff: cc/layers/nine_patch_layer_impl.cc

Issue 1062043003: cc: Add ResourceId validation checks at the time of AppendQuads. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: resource-validate: fixtests Created 5 years, 8 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
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 "cc/layers/nine_patch_layer_impl.h" 5 #include "cc/layers/nine_patch_layer_impl.h"
6 6
7 #include "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "cc/base/math_util.h" 9 #include "cc/base/math_util.h"
10 #include "cc/quads/texture_draw_quad.h" 10 #include "cc/quads/texture_draw_quad.h"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 93
94 if (!ui_resource_id_) 94 if (!ui_resource_id_)
95 return; 95 return;
96 96
97 ResourceProvider::ResourceId resource = 97 ResourceProvider::ResourceId resource =
98 layer_tree_impl()->ResourceIdForUIResource(ui_resource_id_); 98 layer_tree_impl()->ResourceIdForUIResource(ui_resource_id_);
99 99
100 if (!resource) 100 if (!resource)
101 return; 101 return;
102 102
103 // TODO(danakj): crbug.com/455931
104 layer_tree_impl()->resource_provider()->ValidateResource(resource);
105
103 static const bool flipped = false; 106 static const bool flipped = false;
104 static const bool nearest_neighbor = false; 107 static const bool nearest_neighbor = false;
105 static const bool premultiplied_alpha = true; 108 static const bool premultiplied_alpha = true;
106 109
107 DCHECK(!bounds().IsEmpty()); 110 DCHECK(!bounds().IsEmpty());
108 111
109 // NinePatch border widths in layer space. 112 // NinePatch border widths in layer space.
110 int layer_left_width = border_.x(); 113 int layer_left_width = border_.x();
111 int layer_top_height = border_.y(); 114 int layer_top_height = border_.y();
112 int layer_right_width = border_.width() - layer_left_width; 115 int layer_right_width = border_.width() - layer_left_width;
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 result->Set("ImageBounds", list); 427 result->Set("ImageBounds", list);
425 428
426 result->Set("Border", MathUtil::AsValue(border_).release()); 429 result->Set("Border", MathUtil::AsValue(border_).release());
427 430
428 result->SetBoolean("FillCenter", fill_center_); 431 result->SetBoolean("FillCenter", fill_center_);
429 432
430 return result; 433 return result;
431 } 434 }
432 435
433 } // namespace cc 436 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/io_surface_layer_impl_unittest.cc ('k') | cc/layers/nine_patch_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698