| // Copyright 2019 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| syntax = "proto2"; |
| |
| package content.fuzzing.proto; |
| |
| message RenderPass { |
| required Rect output_rect = 1; |
| required Rect damage_rect = 2; |
| repeated DrawQuad quad_list = 3; |
| optional Transform transform_to_root_target = 4; |
| } |
| |
| message DrawQuad { |
| // If not present, defaults to same dimensions as quad, with identity |
| // transform (or with |transform_to_root_target| if quad is a |
| // RenderPassDrawQuad). |
| optional SharedQuadState sqs = 1; |
| |
| required Rect rect = 2; |
| required Rect visible_rect = 3; |
| |
| // |oneof| means "at most one of", so be aware that this message could |
| // have none of the following (consider it invalid and skip if so): |
| oneof quad { |
| SolidColorDrawQuad solid_color_quad = 4; |
| TileDrawQuad tile_quad = 5; |
| RenderPassDrawQuad render_pass_quad = 6; |
| } |
| } |
| |
| message SharedQuadState { |
| required Transform transform = 1; |
| required Rect layer_rect = 2; |
| required Rect visible_rect = 3; |
| |
| // TODO(malaykeshav): add fuzzable rounded corner bounds. |
| |
| required Rect clip_rect = 4; |
| required bool is_clipped = 5; |
| required bool are_contents_opaque = 6; |
| |
| // Will be normalized to a float in [0,1]. |
| required fixed32 opacity = 7 [default = 0xffffffff]; |
| |
| // TODO(celineo): add fuzzable SkBlendMode, crbug.com/923088 |
| |
| required sint32 sorting_context_id = 9; |
| } |
| |
| message SolidColorDrawQuad { |
| required fixed32 color = 1 [default = 0xffffffff]; |
| required bool force_anti_aliasing_off = 2; |
| } |
| |
| message TileDrawQuad { |
| required bool needs_blending = 1; |
| |
| // Allocate an SkBitmap from these values and pass the ResourceId |
| // to the TileDrawQuad. |
| required fixed32 texture_color = 2; |
| required Size texture_size = 3; |
| |
| // TODO (celineo): enable fuzzing gfx::RectF |
| required Rect tex_coord_rect = 4; |
| |
| required bool swizzle_contents = 5; |
| required bool is_premultiplied = 6; |
| required bool nearest_neighbor = 7; |
| required bool force_anti_aliasing_off = 8; |
| } |
| |
| message RenderPassDrawQuad { |
| required RenderPass render_pass = 1; |
| |
| // If not present, defaults to DrawQuad's |rect| |
| optional Rect tex_coord_rect = 2; |
| } |
| |
| // Spec to initialize a gfx::Rect. |
| // Defaults to the size of the renderer frame as defined in |
| // fuzzer_browser_process.cc, in the hopes that this generally yields more |
| // interesting values more quickly. |
| message Rect { |
| required sint32 x = 1 [default = 0]; |
| required sint32 y = 2 [default = 0]; |
| required sint32 width = 3 [default = 620]; |
| required sint32 height = 4 [default = 400]; |
| } |
| |
| // maps to a gfx::Size, same defaults as gfx::Rect |
| message Size { |
| required sint32 width = 1 [default = 620]; |
| required sint32 height = 2 [default = 400]; |
| } |
| |
| message Transform { |
| required double rotate = 1 [default = 0]; |
| |
| required float scale_x = 2 [default = 1]; |
| required float scale_y = 3 [default = 1]; |
| |
| required float translate_x = 4 [default = 0]; |
| required float translate_y = 5 [default = 0]; |
| } |